A differential upgrade file generation method, electronic equipment and storage medium
Patent Information
- Application Number
- CN202210607248.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-31
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2042-05-31
AI Technical Summary
In existing technologies, over-the-air firmware upgrades consume a large amount of device memory. How can we reduce the memory space required for differential upgrades and the backup storage space occupied by power-off resume upgrades?
By obtaining the original version file and the target version file, performing block processing, comparing them to form block strongly connected components, determining differential data nodes based on the available upgrade space, and generating differential upgrade files.
This reduces the memory space required for differential upgrades and the backup storage space occupied by power outage recovery upgrades, and reasonably determines the data size of differential upgrade files, reducing the space occupied by redundant data.
Smart Images

Figure CN117193835B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a differential upgrade file generation method, electronic device, and storage medium. Background Technology
[0002] With the rapid development of technology, the number of IoT devices is constantly increasing. Generally speaking, before being put into the market, IoT devices need to undergo various tests to ensure their stable and reliable functions. However, the iterative progress of IoT technology and the continuous changes in user needs have significantly shortened the time to market and the testing cycle of IoT devices. Therefore, ensuring the continuous updability of IoT devices already on the market has become an important research direction in the industry.
[0003] Over-the-air (OTA) firmware update technology is a technique that uses specific network communication protocols to download remote firmware update packages, enabling firmware updates for deployed IoT devices. However, the OTA firmware update process consumes a significant amount of device memory. Therefore, reducing the memory required for differential upgrades and minimizing the backup storage space required for power-off recovery upgrades have become pressing issues for industry professionals. Summary of the Invention
[0004] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a differential upgrade file generation method, which can reduce the memory space required for differential upgrades in over-the-air firmware upgrades, and reduce the backup storage space occupied by power-off resume upgrades.
[0005] The differential upgrade file generation method according to the first aspect of this application includes: obtaining an original version file, a target version file, and available upgrade space in the device to be upgraded; dividing the original version file into blocks to obtain multiple original data blocks; dividing the target version file into blocks to obtain multiple target data blocks; comparing each of the target data blocks obtained by the block division with the multiple original data blocks in sequence to obtain a first dependency relationship between the original data blocks and the target data blocks; arranging the multiple target data blocks in a first type according to the original data blocks and the first dependency relationship to form strongly connected components of each block; determining each differential data node according to the available upgrade space and each strongly connected component of the block; and generating a differential upgrade file according to each differential data node.
[0006] Secondly, embodiments of this application provide an electronic device, including: a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement a differential upgrade file generation method as described in any one of the embodiments of the first aspect of this application.
[0007] Thirdly, embodiments of this application provide a computer-readable storage medium storing a program that is executed by a processor to implement a differential upgrade file generation method as described in any one of the embodiments of the first aspect of this application.
[0008] The differential upgrade file generation method, electronic device, and storage medium according to the embodiments of this application have at least the following beneficial effects:
[0009] The differential upgrade file generation method of this application first obtains the original version file, the target version file, and the available upgrade space in the device to be upgraded. Then, the original version file is processed into multiple original data blocks, and the target version file is processed into multiple target data blocks. Each target data block obtained by the block processing is then compared with the multiple original data blocks to obtain the first dependency relationship between the original data blocks and the target data blocks. Further, based on the original data blocks and the first dependency relationship, the multiple target data blocks obtained after the block processing of the target version file are arranged in a first type to form strongly connected components of each block. Then, based on the available upgrade space and the strongly connected components of each block, each differential data node is determined. Finally, the differential upgrade file is generated based on each differential data node. Based on the original version file and the target version file, this application further determines the differential data nodes by referring to the available upgrade space in the device to be upgraded, and then generates a differential upgrade file based on the differential data nodes. This can reasonably determine the data capacity of the differential upgrade file, reduce the space occupied by redundant data, thereby reducing the memory space required for differential upgrades in over-the-air firmware upgrades, and reducing the backup storage space occupied by power outage resume upgrades. Attached Figure Description
[0010] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0011] Figure 1 This is a schematic diagram of the differential upgrade file generation method provided in an embodiment of this application;
[0012] Figure 2 This is the directed graph of the original file obtained after the original version file is processed into blocks in the embodiments of this application;
[0013] Figure 3 This is the directed graph of target files obtained by arranging the target version files in the first category in the embodiments of this application;
[0014] Figure 4 Another flowchart illustrating the differential upgrade file generation method provided in this application embodiment;
[0015] Figure 5 Another flowchart illustrating the differential upgrade file generation method provided in this application embodiment;
[0016] Figure 6 Another flowchart illustrating the differential upgrade file generation method provided in this application embodiment;
[0017] Figure 7 This is a schematic diagram illustrating the partitioning of the original version array obtained in the embodiments of this application;
[0018] Figure 8 Another flowchart illustrating the differential upgrade file generation method provided in this application embodiment;
[0019] Figure 9 Another flowchart illustrating the differential upgrade file generation method provided in this application embodiment;
[0020] Figure 10 Another flowchart illustrating the differential upgrade file generation method provided in this application embodiment;
[0021] Figure 11 Another flowchart illustrating the differential upgrade file generation method provided in this application embodiment;
[0022] Figure 12 Another flowchart illustrating the differential upgrade file generation method provided in this application embodiment;
[0023] Figure 13 Another flowchart illustrating the differential upgrade file generation method provided in this application embodiment;
[0024] Figure 14 A schematic diagram of an electronic device for performing a differential upgrade file generation method provided in an embodiment of this application. Detailed Implementation
[0025] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0026] In the description of this application, "several" means one or more, "more than" means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. The use of "first" and "second" in the description is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.
[0027] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0028] In the description of this application, the identification of specific steps does not imply a limitation on the order of steps and execution logic. The execution order and execution logic between each step should be understood and inferred from the content described in the embodiments.
[0029] With the rapid development of technology, the number of IoT devices is constantly increasing. Generally speaking, before being put into the market, IoT devices need to undergo various tests to ensure their stable and reliable functions. However, the iterative progress of IoT technology and the continuous changes in user needs have significantly shortened the time to market and the testing cycle of IoT devices. Therefore, ensuring the continuous updability of IoT devices already on the market has become an important research direction in the industry.
[0030] Firmware Over-The-Air (FOTA) technology refers to providing firmware upgrade services for network-enabled devices via cloud-based upgrade technology. In the field of IoT communication modules, FOTA is mainly used to update and upgrade internal software modules of chips, performing functional optimizations and customized upgrades. It should be understood that FOTA is a technology that uses specific network communication protocols to download remote firmware update packages to update the firmware of already deployed IoT devices. According to FOTA-related technologies, memory is a valuable computing resource in mobile internet devices. If the FOTA upgrade process consumes a large amount of memory, it will increase hardware costs. Therefore, how to reduce the memory space required for differential upgrades in over-the-air firmware upgrades has become a pressing problem for industry professionals.
[0031] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a differential upgrade file generation method that can reduce the memory space required for differential upgrades in over-the-air firmware upgrades.
[0032] The following is a further explanation based on the accompanying drawings.
[0033] Reference Figure 1 The differential upgrade file generation method provided in the first aspect of this application may include, but is not limited to, the following operations.
[0034] Step S101: Obtain the original version file, the target version file, and the available upgrade space in the device to be upgraded;
[0035] In some embodiments of this application, the original version file and the target version file can be obtained by downloading from the network, by data transmission using a removable storage medium, or by other means. It should be understood that the purpose of obtaining the original version file and the target version file is to compare the data differences between them to determine the data content that needs to be entered into the differential upgrade file. Obtaining the available upgrade space in the device to be upgraded aims to rationally divide the data content to be entered into the differential upgrade file based on the available upgrade space, thereby reducing the space occupied by redundant data during the over-the-air firmware upgrade process and further reducing the memory space required for the differential upgrade. The available upgrade space in some embodiments of this application includes, but is not limited to, the memory size and FLASH storage space size of the device to be upgraded. It should be understood that to ensure that the differential upgrade process and data backup are not affected, embodiments of this application generally need to refer to both the memory size and the FLASH storage space size of the device to be upgraded. In some embodiments, if data backup is not required during the differential upgrade process, only the memory size of the device to be upgraded needs to be referred to.
[0036] Step S102: The original version file is divided into blocks to obtain multiple original data blocks, and the target version file is divided into blocks to obtain multiple target data blocks.
[0037] To facilitate the reasonable division of data content for differential upgrade files, according to some embodiments provided in this application, it is necessary to pre-process the original version file into multiple original data blocks and the target version file into multiple target data blocks. This involves dividing the original and target version files into multiple blocks according to preset block lengths. The preset block length is an integer multiple of the smallest unit of the erase / write FLASH device corresponding to the original and target version files, and is less than or equal to the lengths of the original and target version files. For example, if the smallest unit of the erase / write FLASH device is 128KB, the target version file length is 2.1MB, and the original version file length is 2.15MB, the maximum preset block length is set to be no more than the original and target version files and an integer multiple of 1024 bytes. Therefore, the maximum preset block length is 2MB, and the minimum preset block length is 128KB. When selecting a preset block length, it can be increased from the minimum to twice the maximum. For example, in this case, the candidate block lengths are {128K, 256K, 512K, 1M, 2M}.
[0038] Step S103: Compare each target data block obtained from the block processing with multiple original data blocks in sequence to obtain the first dependency relationship between the original data blocks and the target data blocks.
[0039] In some embodiments of this application, the first dependency relationship can be obtained as follows: Based on multiple original data blocks obtained after block processing of the original version file, common substrings are compared sequentially in the target version file after block processing. When a specific target data block and another specific original data block have the longest common substring, a mapping relationship is established between these two data blocks. After traversing all original data blocks and all target data blocks obtained through block processing, the first dependency relationship between the blocks of the original version file and the blocks of the target version file can be obtained. It should be understood that the purpose of obtaining the first dependency relationship between the original data blocks and the target data blocks in this application is to determine which original data blocks in the original version file have been updated by the target version file, and to facilitate the formation of strongly connected components of each block in subsequent steps. It should be understood that the strongly connected components of the blocks in this application refer to the strongly connected components formed based on the target data blocks.
[0040] Step S104: Based on the original data blocks and the first dependency relationship, the multiple target data blocks obtained after the target version file is processed are arranged in the first type to form strongly connected components of each block.
[0041] According to the embodiments provided in this application, the first type of arrangement refers to rearranging multiple target data blocks in a default order according to a first dependency relationship, so that they correspond to the arrangement order of the multiple original data blocks. In some embodiments of this application, after processing the original version file blocks, multiple original data blocks can be obtained, such as... Figure 2 The shown blocks are 1, 2, 3, 4, 5, 6, 7, and 8. If block 1 references data from block 2, there is an edge pointing from block node 1 to block node 2. If block 3 references data from blocks 4 and 7, there are two edges pointing from block node 3 to block node 4 and from block node 3 to block node 7, respectively. Similarly, block 2 references block 3, block 4 references block 5, block 5 references block 6, block 6 references block 1, and block 7 references block 8. In the above embodiment, based on the original data blocks and the first dependency relationship, after processing the target version file into blocks, the multiple target data blocks are arranged in a first-type order to obtain... Figure 3 The data blocks shown are A, B, C, D, E, F, G, H, I, and J. The first dependencies between the original data blocks and the target data blocks are as follows: Target data block A depends on original data block 1; Target data block B depends on original data block 2; Target data block C depends on original data block 3; Target data block D depends on original data block 4; Target data block E depends on original data block 5; Target data block F depends on original data block 6; Target data block G depends on original data block 7; and Target data block H depends on original data block 8. Additionally, Figure 3 In the illustrated embodiment, the target version file adds target data block I and target data block J compared to the original version file. Block I references block A, and block J references block H. Therefore, it can be determined that target data blocks I and target data blocks J are the data contents that need to be newly entered into the differential upgrade file for over-the-air firmware upgrade of the device to be upgraded.
[0042] Strong connectivity refers to a directed graph where, given two vertices a and b, there is a path from a to b, and another path from b to a. These two vertices (a, b) are strongly connected. A strongly connected component is a subgraph within the directed graph where every pair of vertices in the subgraph is strongly connected. The Tarjan algorithm is a common method for finding strongly connected components in a directed graph; this is a standard method, and its process will not be described in detail here. For example... Figure 2 The strongly connected components are {1, 2, 3, 4, 5, 6}, {7}, and {8}, among which {1, 2, 3, 4, 5, 6} is the largest strongly connected component, which has 6 members. For example... Figure 3 The strongly connected components are {A, B, C, D, E, F}, {G}, {H}, {I}, J}, among which {A, B, C, D, E, F} is the largest strongly connected component, which has 6 members.
[0043] In some embodiments provided in this application, the purpose of forming each block of strongly connected components is: firstly, to determine the data content that needs to be entered into the differential upgrade file, and to determine the association between the original version file and the data content of the differential upgrade file; secondly, the strongly connected components formed by arranging multiple target data blocks in the first type can determine the memory size or storage space size required by the device to be upgraded during the over-the-air firmware upgrade process.
[0044] It should be understood that various types of reference relationships often exist between different data blocks of a file. For example, block A might reference data in block B. If, during data transmission, only block A is transmitted without transmitting the referenced block B, the data structure of block A will be incomplete, making block A a fragmented data block. Therefore, it is necessary to ensure the integrity of the data structure during over-the-air (OTA) firmware upgrades. Furthermore, because ensuring the integrity of the data structure is crucial during OTA firmware upgrades, each data block in the strongly connected component (FCB) needs to be completely restored during the OTA firmware upgrade process. In other words, the size of the FCB determines the amount of memory or storage space occupied by the device being upgraded during the OTA firmware upgrade process.
[0045] Step S105: Determine each differential data node based on the available upgrade space and each block strongly connected component;
[0046] Step S106: Generate differential upgrade files based on each of the differential data nodes.
[0047] According to some embodiments provided in this application, the size of the block strongly connected components determines the memory size or storage space size occupied by the device to be upgraded during the over-the-air firmware upgrade process. Therefore, by referring to the available upgrade space and the size of each block strongly connected component, the data content that needs to be entered into the differential upgrade file is reasonably divided, and then each differential data node is determined to reduce the space occupation of redundant data during the over-the-air firmware upgrade process, and finally reduce the memory space required for differential upgrade.
[0048] In some embodiments provided in this application, generating differential upgrade files based on the various differential data nodes requires first determining the differential upgrade order according to the arrangement of the differential data nodes. Within the same differential data node, blocks are upgraded simultaneously. Furthermore, differential upgrade files are generated based on the differential data nodes according to the differential upgrade order. It should be understood that data blocks within the same differential data node have reference relationships; therefore, for each data block within the same differential data node to be completely restored, blocks within the same differential data node need to be upgraded simultaneously.
[0049] The differential upgrade file generation method of this application first obtains the original version file, the target version file, and the available upgrade space in the device to be upgraded. Then, the original version file is divided into blocks to obtain multiple original data blocks, and the target version file is divided into blocks to obtain multiple target data blocks. Then, each target data block obtained by the block processing is compared with the multiple original data blocks in turn to obtain the first dependency relationship between the original data blocks and the target data blocks. Further, according to the original data blocks and the first dependency relationship, the multiple target data blocks obtained after the block processing of the target version file are arranged in the first type to form strong connected components of each block. Then, according to the available upgrade space and the strong connected components of each block, each differential data node is determined. Finally, each differential data node is packaged to generate a differential upgrade file. Based on the original version file and the target version file, this application further determines the differential data nodes by referring to the available upgrade space in the device to be upgraded, and then generates a differential upgrade file based on the differential data nodes. This can reasonably determine the data capacity of the differential upgrade file, reduce the space occupied by redundant data, thereby reducing the memory space required for differential upgrades in over-the-air firmware upgrades, and reducing the backup storage space occupied by power outage resume upgrades.
[0050] Reference Figure 4 According to some embodiments provided in this application, determining each differential data node based on the available upgrade space and each block strongly connected component may include, but is not limited to, the following operations.
[0051] Step S401: Determine the largest block strongly connected component among all the block strongly connected components. The largest block strongly connected component is the block strongly connected component with the most members.
[0052] It should be understood that, because over-the-air (OTA) firmware upgrades require ensuring the integrity of the data structure, each data block in the strongly connected component needs to be completely restored during the OTA firmware upgrade process. In other words, the size of the strongly connected component determines the amount of memory or storage space occupied by the device being upgraded during the OTA firmware upgrade process.
[0053] In one exemplary embodiment, the size of the largest strongly connected component determines the amount of memory or storage space occupied by the device to be upgraded during over-the-air firmware upgrades. According to some embodiments provided in this application, each data block within the same strongly connected component needs to be upgraded and erased / written simultaneously. This prevents referenced blocks from being erased / written prematurely, thus avoiding incomplete data structures for some data blocks. Consequently, the upgrade and erasure / writing of the largest strongly connected component consumes the most available upgrade space from the device to be upgraded.
[0054] Step S402: Based on the data capacity of the largest block strongly connected component and the available upgrade space, determine each differential data node from multiple target data blocks.
[0055] Upgrading and erasing the largest block of strongly connected components consumes the most available upgrade space on the device to be upgraded. Therefore, based on the data capacity of the largest block of strongly connected components and the available upgrade space, by determining each differential data node from multiple target data blocks, the data content to be entered into the differential upgrade file can be reasonably divided, thereby determining each differential data node. This reduces the space occupied by redundant data during over-the-air firmware upgrades, ultimately reducing the memory space required for differential upgrades.
[0056] Reference Figure 5 According to some embodiments provided in this application, based on the data capacity of the largest block strongly connected component and the available upgrade space, each differential data node is determined from multiple target data blocks, including:
[0057] Step S501: Based on the available upgrade space, determine whether the data capacity of the largest block strongly connected component meets the preset upgrade conditions.
[0058] According to some embodiments provided in this application, preset upgrade conditions refer to pre-set data capacity conditions sufficient to enable the device to be upgraded to perform over-the-air firmware upgrades normally. It should be understood that preset upgrade conditions are related to the available upgrade space's data capacity. The available upgrade space in some embodiments of this application includes, but is not limited to, the memory size and FLASH storage space size of the device to be upgraded. It should be understood that, to ensure that the differential upgrade process and data backup are not affected, embodiments of this application generally need to refer to both the memory size and FLASH storage space size of the device to be upgraded. In some embodiments, if data backup is not required during the differential upgrade process, then only the memory size of the device to be upgraded may be referenced.
[0059] In some embodiments of this application, when referring only to the memory size of the device to be upgraded, the corresponding preset upgrade condition may be: the data capacity of the largest block strongly connected component needs to be less than the available memory of the device to be upgraded. It should be understood that the size of the available memory may depend on the hardware conditions of the device or on a preset memory threshold. When the data capacity of the largest block strongly connected component is less than the available memory of the device to be upgraded, it can be determined that the memory space consumed by the upgrade and erasure / writing of the largest block strongly connected component is within the range defined by the available memory and will not affect the normal over-the-air firmware upgrade of the device to be upgraded.
[0060] In other embodiments of this application, when both the memory size of the device to be upgraded and the available storage space of the device to be upgraded are considered simultaneously, the corresponding preset upgrade conditions may be: the data capacity of the largest block strongly connected component is less than the available memory, and the sum of the data capacity of the largest block strongly connected component and the differential upgrade file is less than the available storage space. It should be understood that the available memory size of the device to be upgraded determines whether the device can perform over-the-air firmware upgrades normally, and the available storage space size of the device to be upgraded determines whether the device can perform backup storage normally during over-the-air firmware upgrades. According to some embodiments of this application, the preset upgrade conditions can be flexibly set according to the application scenario and application requirements, and the types of preset upgrade conditions are not limited to the specific embodiments mentioned above.
[0061] Step S502: When the data capacity of the largest block strongly connected component meets the preset upgrade conditions, determine each differential data node based on each block strongly connected component.
[0062] According to some embodiments provided in this application, when the data capacity of the largest block strongly connected component meets the preset upgrade conditions, the differential upgrade file generation method in this application embodiment can be determined. The division of the data content to be entered into the differential upgrade file based on each block strongly connected component is a reasonable data division. Therefore, packaging the obtained differential data nodes to generate a differential upgrade file can reduce the space occupation of redundant data during the over-the-air firmware upgrade process, and ultimately reduce the memory space required for differential upgrade.
[0063] Reference Figure 6 According to some embodiments provided in this application, determining each differential data node from multiple target data blocks based on the data capacity size of the largest block strongly connected component and the available upgrade space further includes:
[0064] Step S601: When the data capacity of the largest block strongly connected component does not meet the preset upgrade conditions, the original version file after block processing is divided according to the first dependency relationship and the reference relationship between each block strongly connected component to obtain multiple original version arrays.
[0065] According to some embodiments provided in this application, when the data capacity of the largest strongly connected component does not meet the preset upgrade conditions, it indicates that the data capacity of the largest strongly connected component does not match the available upgrade space. It should be understood that the data capacity of the largest strongly connected component not meeting the preset upgrade conditions generally means that the data capacity of the largest strongly connected component exceeds the available upgrade space of the device to be upgraded. If each differential data node is still determined based on each strongly connected component, the device to be upgraded will consume more memory or storage space than the available upgrade space during the over-the-air firmware upgrade process. This will cause the memory used for other processing processes or the storage space used for storing other files to be occupied during the over-the-air firmware upgrade process. Therefore, when the data capacity of the largest strongly connected component does not meet the preset upgrade conditions, it is necessary to divide the original version file after block processing according to the first dependency relationship and the reference relationship between each strongly connected component to obtain multiple original version arrays, so that the multiple target data blocks obtained after block processing can be arranged in a second type in subsequent steps.
[0066] Reference Figure 2 , Figure 3 Some embodiments are shown, wherein Figure 2 A directed graph of the original file reflecting the reference relationships between multiple original data blocks. Figure 3 The target file is a directed graph formed by arranging multiple target data blocks after the target file has been processed into blocks. It is clear that the original file's directed graph and the target file's directed graph have data blocks with the same topological structure, namely blocks 1, 2, 3, 4, 5, 6, 7, and 8 of the original file's directed graph, and blocks A, B, C, D, E, F, G, and H of the target file's directed graph. Specifically, target data block A depends on original data block 1, target data block B depends on original data block 2, target data block C depends on original data block 3, target data block D depends on original data block 4, target data block E depends on original data block 5, target data block F depends on original data block 6, target data block G depends on original data block 7, and target data block H depends on original data block 8. It should be understood that data blocks with consistent topology are shared data between the original and target versions of the file. Therefore, based on the strongly connected components of each block in the target version file, and according to the reference relationships between these strongly connected components, as well as the primary dependency relationships between the original and target data blocks, the original version file after block processing can be divided into multiple original version arrays.
[0067] In some embodiments of this application, the original version file after block processing is divided according to the first dependency relationship and the reference relationship between each block of strongly connected components to obtain multiple original version arrays. This can be done by obtaining the strongly connected capacity that meets preset upgrade conditions based on the available upgrade space, then determining the partitioning benchmark based on the data capacity of the largest strongly connected component in the array and the strongly connected capacity, and finally further partitioning the original version file after block processing using the partitioning benchmark to obtain multiple original version arrays. For example... Figure 7 , Figure 7 In the illustrated embodiment, step S700 (including the original data blocks with block numbers 1, 2, ..., 7, ...) of the original version file after block processing is divided to obtain multiple original version arrays (including original version arrays with block numbers 1, 2, ..., N). It should be understood that dividing the original version file after block processing to obtain multiple original version arrays includes, but is not limited to, the specific embodiments described above.
[0068] According to some embodiments provided in this application, the original version file after block processing is divided into multiple original version arrays. The data between each original version array is isolated from each other. Therefore, when comparing the target version file after block processing with the multiple original version arrays in turn, each target data block needs to be divided into blocks and compared in the multiple original version arrays in turn to obtain the second dependency relationship between the original data block and the target data block.
[0069] Step S602: The target version file after block processing is compared with multiple original version arrays in turn to obtain the second dependency relationship between the original data block and the target data block.
[0070] In some embodiments of this application, the second dependency relationship can be obtained in the following manner: After the target version file is processed into multiple target data blocks, each target data block is compared with a common substring in multiple original version arrays. When the target data block is matched with an original data block in a certain original version array whose common string length exceeds a preset threshold, a mapping relationship is established between the two data blocks. After all target data blocks are traversed in each original version array, the second dependency relationship between the original data block and the target data block can be obtained.
[0071] It should be understood that when comparing common substrings in multiple original version arrays for each target data block, if no original data block with a common string length exceeding a preset threshold is found, the comparison is performed from the original version array adjacent to the current original version array until an original data block with a common string length exceeding the preset threshold is found.
[0072] According to the embodiments provided in this application, the difference between the first dependency relationship and the second dependency relationship is as follows:
[0073] The first dependency relationship refers to comparing each target data block with all original data blocks to find the original data block with the longest common substring, thus forming a set of mapping relationships. The second dependency relationship involves iterating through each original version array for each target data block until a matching original version array is found with a common substring length exceeding a preset threshold, also forming a set of mapping relationships. It should be understood that because the second dependency relationship between original and target data blocks does not pursue the maximum correlation (the strongest mapping relationship) as the first dependency relationship, the data capacity of the largest strongly connected component among the strongly connected components formed by the original version array and the second dependency relationship will be less than the data capacity of the largest strongly connected component. It should also be understood that the first and second dependencies can be used to mark a pair of original and target data blocks with a mapping relationship. The marking content includes, but is not limited to: the block number corresponding to the string, the starting position of the string, and the length of the string.
[0074] Step S603: Based on the original version array and the second dependency relationship, perform a second type of arrangement on the multiple target data blocks obtained after the target version file is processed into blocks, forming strongly connected components of each array.
[0075] According to the embodiments provided in this application, the second type of arrangement refers to rearranging multiple target data blocks in a default order according to a second dependency relationship, so that they correspond to the arrangement order of the original data blocks in each original version array. It should be understood that, based on the second dependency relationship, performing the second type of arrangement on the multiple target data blocks obtained after processing the target version file blocks can form strongly connected components of each array. In some embodiments of this application, since the original data blocks between each original version array are isolated from each other, the strongly connected components of each array formed by the second type of arrangement have different topological structures than the strongly connected components of each block formed by the first type of arrangement. Specifically, the data capacity of the largest strongly connected component of the array formed by the second type of arrangement will be smaller than the data capacity of the largest strongly connected component of the block formed by the first type of arrangement.
[0076] Step S604: Determine the largest strongly connected component among the strongly connected components of each array;
[0077] Step S605: When the data capacity of the largest strongly connected component of the array meets the preset upgrade conditions, determine each differential data node based on each strongly connected component of the array.
[0078] According to some embodiments provided in this application, the preset upgrade conditions refer to the data capacity conditions sufficient to enable the device to be upgraded to perform over-the-air firmware upgrades normally. In some embodiments of this application, when the data capacity of the largest strongly connected component in the array meets the preset upgrade conditions, it can be determined that the differential upgrade file generation method in this application, based on the division of the data content to be entered into the differential upgrade file according to each block of strongly connected components, is a reasonable data division.
[0079] In some embodiments of this application, the preset upgrade condition may be: the data capacity of the largest strongly connected component of the array is less than the available memory, and the sum of the data capacity of the largest strongly connected component of the array and the differential upgrade file is less than the available storage space. It should be understood that the available memory size of the device to be upgraded determines whether the device can perform an over-the-air firmware upgrade normally, and the available storage space size of the device to be upgraded determines whether the device can perform backup storage normally during the over-the-air firmware upgrade. According to some embodiments of this application, the preset upgrade condition can be flexibly set according to the application scenario and application requirements, and the type of preset upgrade condition is not limited to the specific embodiments mentioned above. It should be understood that the preset upgrade condition is related to the data capacity of the available upgrade space. The available upgrade space in some embodiments of this application includes, but is not limited to, the memory size of the device to be upgraded and the FLASH storage space size of the device to be upgraded. It should be understood that in order to ensure that the differential upgrade process and data backup are not affected, the embodiments of this application generally need to refer to both the memory size of the device to be upgraded and the FLASH storage space size. In some embodiments, if data backup is not required during the differential upgrade process, only the memory size of the device to be upgraded can be referred to.
[0080] Reference Figure 8 According to some embodiments provided in this application, the original version file after block processing is divided to obtain multiple original version arrays, including:
[0081] Step S801: Based on the available upgrade space, obtain the strong connectivity limit capacity that meets the preset upgrade conditions;
[0082] According to some embodiments provided in this application, the data content that needs to be entered into the differential upgrade file can be reasonably divided based on the available upgrade space of the device to be upgraded, thereby reducing the space occupied by redundant data during the over-the-air firmware upgrade process and further reducing the memory space required for differential upgrade. The available upgrade space in some embodiments of this application includes, but is not limited to, the memory size of the device to be upgraded and the FLASH storage space size of the device to be upgraded. It should be understood that, in order to ensure that the differential upgrade process and data backup are not affected, the strong connectivity limit capacity that meets the preset upgrade conditions needs to depend on both the memory size of the device to be upgraded and the FLASH storage space size. In other embodiments of this application, if data backup is not required during the differential upgrade process, the strong connectivity limit capacity that meets the preset upgrade conditions can also depend only on the memory size of the device to be upgraded.
[0083] Step S802: Determine the partitioning benchmark based on the data capacity of the largest block strongly connected component and the strongly connected constraint capacity;
[0084] Step S803: Divide the multiple original data blocks according to the partitioning benchmark to obtain multiple original version arrays.
[0085] According to some embodiments provided in this application, after obtaining the strong connectivity limit capacity, it is necessary to further compare the data capacity of the largest block strong connectivity component with the strong connectivity limit capacity to determine the partitioning benchmark. This is to clarify the benchmark by which the original version file after block processing is partitioned so that the data capacity of the largest array strong connectivity component is less than the strong connectivity limit capacity, thereby obtaining multiple original version arrays, so that the space occupied during the over-the-air firmware upgrade process does not exceed the size of the available upgrade space.
[0086] In some embodiments of this application, the original version file after block processing is divided according to the first dependency relationship and the reference relationship between each block of strongly connected components to obtain multiple original version arrays. This can be done by obtaining the strongly connected capacity that meets preset upgrade conditions based on the available upgrade space, then determining the partitioning benchmark based on the data capacity of the largest strongly connected component in the array and the strongly connected capacity, and finally further partitioning the original version file after block processing using the partitioning benchmark to obtain multiple original version arrays. For example... Figure 7 , Figure 7 In the illustrated embodiment, step S700 (including the original data blocks with block numbers 1, 2, ..., 7, ...) of the original version file after block processing is divided to obtain multiple original version arrays (including original version arrays with block numbers 1, 2, ..., N). It should be understood that dividing the original version file after block processing to obtain multiple original version arrays includes, but is not limited to, the specific embodiments described above.
[0087] Reference Figure 2 , Figure 3 , Figure 7 In some more specific embodiments of this application, firstly according to Figure 2 The diagram shows the arrangement order of multiple original data blocks and the first dependency relationship between the original data blocks and the target data blocks. The multiple target data blocks in the default order are then arranged in a first-type permutation to form... Figure 3 The strongly connected components of each block are shown. Further, the largest strongly connected component, {A, B, C, D, E, F}, is obtained, with a data capacity of 6 units. Based on the available upgrade space, the strongly connected capacity limit satisfying the preset upgrade conditions is 3 units. Based on the data capacity of the largest strongly connected component (6 units) and the strongly connected capacity limit (3 units), and because {A, B, C, D, E, F} and {1, 2, 3, 4, 5, 6} are data blocks with the same topological structure, the partitioning criterion can be determined: Multiple original data blocks are partitioned to obtain multiple original version arrays. {1, 2, 3, 4, 5, 6}, which has a dependency relationship with the largest strongly connected component {A, B, C, D, E, F}, needs to be partitioned into an original version array with a data capacity no greater than the strongly connected capacity limit (3 units), such as... Figure 7 The diagram shows that {1, 2, 3} is assigned to original version array 1, {4, 5, 6} is assigned to original version array 2, and the remaining original data is divided into blocks and assigned to other original version arrays, ultimately resulting in multiple original version arrays.
[0088] It should be understood that the data blocks corresponding to the original version array can also be divided unequally, or there may be overlapping areas between the data blocks. When optimizing the algorithm, the division of the original version array can be dynamically adjusted according to the specific situation of the differences and data dependencies between different versions of data, so as to make the most of the original data and further reduce the size of the differential upgrade file to meet the needs of practical applications.
[0089] It should be emphasized that, based on the multiple original version arrays and the second dependency relationship obtained from the above embodiments, the multiple target data blocks obtained after the target version file is processed into blocks are reasonably arranged in the second type to form the largest array strongly connected component that meets the preset upgrade conditions. Each differential data node is determined and packaged according to each array strongly connected component. This can reasonably determine the data capacity of the differential upgrade file, reduce the space occupation of redundant data, and thus reduce the memory space required for differential upgrade in over-the-air firmware upgrade.
[0090] It should be understood that the division of the original version file after block processing in this application to obtain multiple original version arrays can be accomplished in various ways, and is not limited to the specific embodiments mentioned above.
[0091] Reference Figure 9According to some embodiments provided in this application, the available upgrade space includes the available memory and available storage space of the device to be upgraded. Based on the available upgrade space, it is determined whether the data capacity of the largest block strongly connected component meets the preset upgrade conditions, including:
[0092] Step S901: Determine whether the data capacity of the largest strongly connected component is less than the available memory;
[0093] Step S902: Determine whether the sum of the data capacity of the largest block strongly connected component and the differential upgrade file is less than the available storage space;
[0094] Step S903: When the data capacity of the largest block strongly connected component is less than the available memory, and the sum of the data capacities of the largest block strongly connected component and the differential upgrade file is less than the available storage space, it is determined that the data capacity of the largest block strongly connected component meets the preset upgrade conditions.
[0095] According to some embodiments provided in this application, the preset upgrade conditions generally depend on the memory size and FLASH storage space size of the device to be upgraded. In one exemplary embodiment, when the data capacity of the largest strongly connected component (FCS) is less than the available memory, and the sum of the data capacities of the FCS and the differential upgrade file is less than the available storage space, the data capacity of the FCS then satisfies the preset upgrade conditions. It should be understood that by taking into account both the memory size and FLASH storage space size of the device to be upgraded, the differential upgrade process and data backup can be protected from the impact of insufficient memory and storage space. This allows for a reasonable division of the data content to be entered into the differential upgrade file, reducing the space occupied by redundant data during the over-the-air firmware upgrade process, and further reducing the memory space required for the differential upgrade.
[0096] According to some specific embodiments provided in this application, the preset upgrade condition for determining the data capacity of the largest block strongly connected component is as follows:
[0097] C_strongly_connected_size <A_ram;
[0098] C_strongly_connected_size+D_delta_size <B_rom;
[0099] Where C_strongly_connected_size is the size of the largest block of strongly connected components, A_ram is the available memory of the device to be upgraded, D_delta_size is the size of the differential upgrade file, and B_rom is the available storage space of the device to be upgraded.
[0100] Reference Figure 10 According to some embodiments provided in this application, before determining whether the sum of the data capacity of the largest block strongly connected component and the differential upgrade file is less than the available storage space, the method further includes obtaining the size of the differential upgrade file. In one exemplary embodiment:
[0101] Step S1001: Compare the target version file with the original version file to obtain the new content in the target version file that is different from the original version file;
[0102] Step S1002: Obtain the data capacity of the differential upgrade file based on the data capacity of the newly added content.
[0103] According to some embodiments provided in this application, the size of the differential upgrade file can be obtained by comparing the string information of the original version file and the target version file. For example, a dictionary can be formed for all substrings in the original version file, and then the original version file and the target version file can be compared to generate a Diff String (common string) and an Extra String (difference string). Furthermore, the data capacity of the differential upgrade file can be obtained based on the Diff String and the Extra String.
[0104] Reference Figure 11 According to some embodiments provided in this application, each target data block obtained by block processing is sequentially compared with multiple original data blocks to obtain a first dependency relationship between the original data blocks and the target data blocks, including:
[0105] Step S1101: Based on each target data block after block processing, perform common substring comparisons sequentially in multiple original data blocks obtained after block processing of the original version file.
[0106] Step S1102: When the target data block and the original data block have the longest common substring, the first dependency relationship is obtained based on the target data block and the original data block.
[0107] According to some embodiments provided in this application, multiple original data blocks obtained after block processing of the original version file are sequentially compared with common substrings in the target version file after block processing. The purpose is to find the original data block corresponding to each target version file from the original version file after block processing. When the target data block and the original data block have the longest common substring, it means that the similarity between the two data blocks is the highest. Therefore, the space occupied by redundant data can be reduced when constructing the differential upgrade file, thereby reducing the memory space required for differential upgrade in over-the-air firmware upgrade.
[0108] Reference Figure 12According to some embodiments provided in this application, based on the original data blocks and the first dependency relationship, multiple target data blocks obtained after the target version file is processed are arranged in a first type to form strongly connected components of each block, including:
[0109] Step S1201: Determine the original order of each original data block in the original version file;
[0110] Step S1202: Based on the first dependency relationship, the multiple target data blocks are arranged in the first type according to the original arrangement order to form strongly connected components of each block.
[0111] Reference Figure 2 The illustrated embodiment, after determining the original arrangement order of the original data blocks in the original version file, can form a directed graph of the original file reflecting the reference relationships between multiple original data blocks. Further, based on the first dependency relationship, blocks A, B, C, D, E, F, G, and H corresponding to blocks 1, 2, 3, 4, 5, 6, 7, and 8, respectively, can be found from the multiple target data blocks. This allows for a first-type permutation of the multiple target data blocks according to their original arrangement order, ultimately forming strongly connected components for each block and generating a directed graph of the target file, such as... Figure 3 As shown in the diagram. Target data block A depends on original data block 1, target data block B depends on original data block 2, target data block C depends on original data block 3, target data block D depends on original data block 4, target data block E depends on original data block 5, target data block F depends on original data block 6, target data block G depends on original data block 7, and target data block H depends on original data block 8. It should be understood that the target data blocks {A, B, C, D, E, F} with the same topological structure and the original data blocks {1, 2, 3, 4, 5, 6} represent shared data between the original and target version files. It should be understood that, based on the first dependency relationship, multiple target data blocks are arranged in the original order to form strongly connected components, not limited to the specific embodiment described above.
[0112] Reference Figure 13 According to some specific embodiments of this application, the differential upgrade file generation method includes:
[0113] Step S1301: Obtain the original version file and the target version file;
[0114] Step S1302: Enter the available memory size A_ram and the available storage space size B_rom of the device to be upgraded in the differential tool configuration file.
[0115] Step S1303: partition the original version file and the target version file by an integer multiple of the Flash storage block size;
[0116] Step S1304: perform common string comparison on the partitioned original version file and the partitioned target version file to obtain a first dependency relationship between the original data blocks and the target data blocks;
[0117] Step S1305: perform a first type of permutation on the multiple target data blocks obtained after partitioning the target version file based on the original data blocks and the first dependency relationship in combination with the Tarjan algorithm for searching strongly connected components, to form respective block strongly connected components, and obtain the maximum block strongly connected component size C_strongly_connected_size;
[0118] Step S1306: generate differential package construction instructions, and obtain the size D_delta_size of the differential upgrade file;
[0119] Step S1307: determine whether the data capacity of the maximum block strongly connected component is less than the available memory (C_strongly_connected_size<A_ram), and determine whether the sum of the data capacities of the maximum block strongly connected component and the differential upgrade file is less than the available storage space (C_strongly_connected_size+D_delta_size<B_rom);
[0120] Step S1308: when the data capacity of the maximum block strongly connected component is less than the available memory, and the sum of the data capacities of the maximum block strongly connected component and the differential upgrade file is less than the available storage space, determine that the data capacity of the maximum block strongly connected component satisfies a preset upgrade condition, determine each differential data node according to each block strongly connected component, package each differential data node to generate the differential upgrade file, and prompt that packaging is successful;
[0121] Step S1309: when the data capacity of the maximum block strongly connected component is not less than the available memory, or the sum of the data capacities of the maximum block strongly connected component and the differential upgrade file is not less than the available storage space, partition the partitioned original version file according to the first dependency relationship and the reference relationship between the respective block strongly connected components to obtain a plurality of original version arrays;
[0122] Step S1310: sequentially compare the partitioned target version file with the plurality of original version arrays to obtain a second dependency relationship between the original data blocks and the target data blocks;
[0123] Step S1311: perform a second type of arrangement on a plurality of target data blocks obtained by performing block processing on the target version file according to the original version array and the second dependency relationship, to obtain the maximum array strongly connected component size D_strongly_connected_size;
[0124] Step S1312: determine whether the data capacity of the maximum array strongly connected component is less than the available memory (D_strongly_connected_size < A_ram), and determine whether the sum of the data capacity of the maximum block strongly connected component and the differential upgrade file is less than the available storage space (D_strongly_connected_size + D_delta_size < B_rom);
[0125] Step S1313: when the data capacity of the maximum array strongly connected component is less than the available memory, and the sum of the data capacity of the maximum array strongly connected component and the differential upgrade file is less than the available storage space, determine that the data capacity of the maximum array strongly connected component satisfies a preset upgrade condition, determine each differential data node according to each array strongly connected component, package each differential data node to generate a differential upgrade file, and prompt that packaging is successful.
[0126] Figure 14 shows an electronic device 1400 provided by an embodiment of the present application. The electronic device 1400 includes a processor 1401, a memory 1402, and a computer program stored on the memory 1402 and executable on the processor 1401, where the computer program is configured to execute the above-mentioned method for generating a differential upgrade file when running.
[0127] The processor 1401 and the memory 1402 may be connected via a bus or in other manners.
[0128] As a non-transitory computer-readable storage medium, the memory 1402 may be configured to store non-transitory software programs and non-transitory computer-executable programs, such as the method for generating a differential upgrade file described in the embodiments of the present application. The processor 1401 implements the above-mentioned method for generating a differential upgrade file by running the non-transitory software programs and instructions stored in the memory 1402.
[0129] The memory 1402 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and application programs required for at least one function. The data storage area may store a differential upgrade file generation method described above. Furthermore, the memory 1402 may include high-speed random access memory 1402, and may also include non-transitory memory 1402, such as at least one storage device, flash memory, or other non-transitory solid-state storage device. In some embodiments, the memory 1402 may optionally include remotely located memories 1402 relative to the processor 1401, which can be connected to the electronic device 1400 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0130] The non-transitory software program and instructions required to implement the differential upgrade file generation method described above are stored in memory 1402. When executed by one or more processors 1401, the differential upgrade file generation method described above is executed, for example, executing... Figure 1 Method steps S101 to S106 in the above method Figure 4 Method steps S401 to S402, Figure 5 Method steps S501 to S502, Figure 6 Method steps S601 to S605, Figure 8 Method steps S801 to S803, Figure 9 Method steps S901 to S903, Figure 10 Method steps S1001 to S1002, Figure 11 Method steps S1101 to S1102, Figure 12 Method steps S1201 to S1202, Figure 13 The method steps S1301 to S1313.
[0131] This application also provides a computer-readable storage medium storing computer-executable instructions for executing the above-described differential upgrade file generation method.
[0132] In one embodiment, the computer-readable storage medium stores computer-executable instructions that are executed by one or more control processors, for example, executing... Figure 1 Method steps S101 to S106 in the above method Figure 4 Method steps S401 to S402, Figure 5 Method steps S501 to S502, Figure 6 Method steps S601 to S605, Figure 8Method steps S801 to S803, Figure 9 Method steps S901 to S903, Figure 10 Method steps S1001 to S1002, Figure 11 Method steps S1101 to S1102, Figure 12 Method steps S1201 to S1202, Figure 13 The method steps S1301 to S1313.
[0133] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0134] Those skilled in the art will understand that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, storage device storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically include computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium. It should also be understood that the various implementation methods provided in this application can be arbitrarily combined to achieve different technical effects.
[0135] The above provides a detailed description of the preferred embodiments of this application. However, this application is not limited to the above-described embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this application. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.
Claims
1. A method for generating differential upgrade files, comprising: Obtain the original version file, the target version file, and the available upgrade space in the device to be upgraded; The original version file is divided into blocks to obtain multiple original data blocks; The target version file is divided into blocks to obtain multiple target data blocks; Each target data block obtained by the block processing is compared with a plurality of original data blocks in turn to obtain a first dependency relationship between the original data blocks and the target data blocks; Based on the original data block and the first dependency relationship, the multiple target data blocks are arranged in a first type to form strongly connected components of each block. Based on the available upgrade space and each of the strongly connected components of the blocks, each differential data node is determined; Generate a differential upgrade file based on each of the differential data nodes; The step of determining each differential data node based on the available upgrade space and each of the strongly connected components of the blocks includes: Determine the largest block strongly connected component among all the block strongly connected components, wherein the largest block strongly connected component is the block strongly connected component with the most members; Based on the available upgrade space in the device to be upgraded, preset upgrade conditions are determined; Based on the data capacity of the largest block strongly connected component and the preset upgrade conditions, each differential data node is determined from multiple target data blocks; The step of determining each differential data node from multiple target data blocks based on the data capacity of the largest strongly connected component and the preset upgrade conditions further includes: When the data capacity of the largest block strongly connected component does not meet the preset upgrade conditions, the original version file after block processing is divided according to the first dependency relationship and the reference relationship between each block strongly connected component to obtain multiple original version arrays. The target version file after being processed into blocks is compared with multiple arrays of original versions in sequence to obtain a second dependency relationship between the original data blocks and the target data blocks; Based on the original version array and the second dependency relationship, the multiple target data blocks obtained after the target version file is processed into blocks are arranged in a second type to form strongly connected components of each array. Determine the largest strongly connected component among all the strongly connected components of the array; When the data capacity of the largest strongly connected component of the array meets the preset upgrade condition, each differential data node is determined according to each strongly connected component of the array.
2. The method according to claim 1, characterized in that, The step of determining each differential data node from multiple target data blocks based on the data capacity of the largest strongly connected component and the preset upgrade conditions includes: When the data capacity of the largest block strongly connected component meets the preset upgrade condition, each differential data node is determined according to each block strongly connected component.
3. The method according to claim 1, characterized in that, The original version file after block processing is divided into multiple original version arrays, including: Based on the available upgrade space, the strong connectivity limit capacity that satisfies the preset upgrade conditions is obtained; The partitioning criterion is determined based on the data capacity of the largest block strongly connected component and the strongly connected constraint capacity; The original data blocks are divided according to the aforementioned dividing criteria to obtain multiple original version arrays.
4. The method according to any one of claims 1 to 3, characterized in that, The available upgrade space includes the available memory and available storage space of the device to be upgraded. The step of determining each differential data node from multiple target data blocks based on the data capacity of the largest strongly connected component and the preset upgrade conditions includes: Determine whether the data capacity of the largest strongly connected component is less than the available memory; Determine whether the sum of the data capacity of the largest block strongly connected component and the differential upgrade file is less than the available storage space; When the data capacity of the largest strongly connected component is less than the available memory, and the sum of the data capacity of the largest strongly connected component and the differential upgrade file is less than the available storage space, it is determined that the data capacity of the largest strongly connected component meets the preset upgrade condition.
5. The method according to any one of claims 1 to 3, characterized in that, The step of comparing each target data block obtained from the block processing with multiple original data blocks in sequence to obtain a first dependency relationship between the original data blocks and the target data blocks includes: Based on the target version file after block processing, common substrings are compared sequentially in multiple original data blocks obtained after block processing of the original version file. When the target data block and the original data block have the longest common substring, the first dependency relationship is obtained based on the target data block and the original data block.
6. The method according to any one of claims 1 to 3, characterized in that, The step of arranging multiple target data blocks into a first type according to the original data blocks and the first dependency relationship to form strongly connected components for each block includes: Determine the original order of each of the original data blocks in the original version file; Based on the first dependency relationship, the multiple target data blocks are arranged in the first type according to the original arrangement order to form strongly connected components of each block.
7. An electronic device, characterized in that, include: The device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement a differential upgrade file generation method as described in any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that, The storage medium stores a program that is executed by a processor to implement a differential upgrade file generation method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Differential upgrade package generation method, device and equipment
CN111258620A
