Differential upgrading method of terminal, differential upgrading device, equipment and medium
By dividing the software system into independent functional modules and generating customized differential packages, the problems of resource waste and time consumption in traditional differential upgrade methods are solved, realizing an efficient and personalized upgrade process, and improving user experience and device performance.
Patent Information
- Application Number
- CN202510567760.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-11-07
AI Technical Summary
Traditional differential upgrade methods cannot meet users' personalized needs, leading to unnecessary waste of resources and time, especially when device storage resources are limited.
The software system is divided into multiple independent functional modules. By comparing the original version file and the upgrade version file of each functional module, the module to be upgraded is determined, and a customized differential package is generated. Users can choose the target module to be upgraded, and the server generates a differential upgrade package containing the specific module.
It reduces the amount of download and storage space required, shortens the upgrade time, improves upgrade efficiency, and reduces the risk that the entire software system may fail to upgrade properly due to problems with a single module.
Smart Images

Figure CN120909629A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of device remote upgrading, in particular to a terminal differential upgrading method, a terminal differential upgrading device, a device and a medium. BACKGROUND
[0002] With the rapid development of the Internet of Things and intelligent devices, OTA (Over-The-Air) technology, as a technology for remotely updating software on devices through wireless networks, has been widely applied in the fields of smart phones, smart home devices, automotive electronic systems, etc. The main advantage of OTA technology is that it can achieve remote maintenance and functional upgrading of devices without relying on physical connections, thereby improving the performance and security of devices.
[0003] Traditional OTA updating methods usually include full upgrade and differential upgrade. Full upgrade refers to downloading the entire firmware or the entire new version of the software package to the device, completely replacing the old version. Although this method is simple and direct, it requires downloading a large amount of data, occupying a large amount of network bandwidth and storage space, especially in the case of limited device storage resources, which may cause a large burden. Differential upgrade is a more efficient updating method, which only downloads the difference between the new and old versions, thereby reducing data transmission volume, shortening updating time, and reducing the occupation of device resources.
[0004] However, even if differential upgrade is adopted, the generated differential package may contain update content of multiple functional modules. For users, they may not need to update all functional modules, but are only interested in certain modules. The traditional differential upgrade method cannot meet this individualized demand, resulting in unnecessary waste of resources and time consumption. SUMMARY
[0005] Therefore, the purpose of the present application is to provide a terminal differential upgrading method, a terminal differential upgrading device, a device and a medium, which divides the software system to be upgraded into multiple independent functional modules, determines the modules to be upgraded by comparing the original version files and the upgraded version files of each functional module. Users can independently select the target functional modules that need to be upgraded, and the server generates a customized differential package containing specific modules according to user selection, so that the terminal does not need to be forced to accept all contents in the entire differential package. The terminal only needs to download the modular differential package selected by the user, avoiding the waste of bandwidth caused by downloading the entire differential package, and reducing the occupation of device storage space. Due to the reduction of data volume for downloading and installation, the time required for the upgrading process is also significantly shortened.
[0006] In a first aspect, an embodiment of the present application provides a differential upgrading method, which is applied to a server; the differential upgrading method comprises:
[0007] When receiving the upgrade request sent by the terminal, the original version file and the upgrade version file corresponding to each function module in the software system are acquired;
[0008] The original version file and the upgrade version file corresponding to each function module are compared, and the to-be-upgraded module is determined from the plurality of function modules, and a difference content mapping table corresponding to the software system is generated based on the to-be-upgraded module;
[0009] The upgrade information of the to-be-upgraded module is sent to the terminal, and a module upgrade request of a target upgrade module sent by the terminal is received and responded, and a difference upgrade package corresponding to the target upgrade module is generated based on the difference content mapping table;
[0010] The difference upgrade package is sent to the terminal, so that the terminal performs difference upgrade on the target upgrade module by using the difference upgrade package.
[0011] Further, the comparison of the original version file and the upgrade version file corresponding to each function module to determine the to-be-upgraded module from the plurality of function modules comprises:
[0012] For each function module, the original version file and the upgrade version file corresponding to the function module are respectively divided according to a preset storage space size, to obtain a plurality of original version storage blocks and a plurality of upgrade version storage blocks;
[0013] For each upgrade version storage block, a to-be-compared storage block corresponding to the upgrade version storage block is determined from the plurality of original version storage blocks based on a storage block identifier of the upgrade version storage block;
[0014] The upgrade version storage block and the to-be-compared storage block are compared, and if it is judged that there is a difference between the upgrade version storage block and the to-be-compared storage block, the upgrade version storage block is determined as a difference storage block, and the function module is determined as the to-be-upgraded module.
[0015] Further, the comparison of the upgrade version storage block and the to-be-compared storage block comprises:
[0016] A first hash value of the upgrade version storage block and a second hash value of the to-be-compared storage block are calculated;
[0017] If the first hash value and the second hash value are not the same, it is considered that there is a difference between the upgrade version storage block and the to-be-compared storage block.
[0018] Further, the generation of the difference content mapping table corresponding to the software system based on the to-be-upgraded module comprises:
[0019] For each to-be-upgraded module, determine the difference content of the difference storage block corresponding to the to-be-upgraded module;
[0020] Store the module identifier corresponding to the to-be-upgraded module, the storage block identifier of the difference storage block corresponding to the to-be-upgraded module, and the difference content of the difference storage block corresponding to the to-be-upgraded module in a mapping relationship to obtain the difference content mapping table.
[0021] Further, the generating of the differential upgrade package corresponding to the target upgrade module based on the difference content mapping table comprises:
[0022] Based on the target module identifier corresponding to the target upgrade module, obtaining the difference content of the difference storage block corresponding to the target upgrade module from the difference content mapping table;
[0023] Packing the difference content of the difference storage block corresponding to the target upgrade module to obtain the differential upgrade package corresponding to the target upgrade module.
[0024] Further, after the sending of the differential upgrade package to the terminal, the differential upgrade method further comprises:
[0025] Calculating a third hash value corresponding to the differential upgrade package;
[0026] Receiving a fourth hash value sent by the terminal, and comparing the third hash value with the fourth hash value to verify the differential upgrade package; wherein the fourth hash value is generated by the terminal based on the received differential upgrade package.
[0027] In a second aspect, the embodiments of the present application further provide a differential upgrade method, which is applied to a terminal; the differential upgrade method comprises:
[0028] In response to a user's upgrade operation on a software system, generating an upgrade request for the software system and sending it to a server;
[0029] Receiving upgrade information of to-be-upgraded modules sent by the server, and displaying the upgrade information of the to-be-upgraded modules; in response to a user's selection operation on any to-be-upgraded module, determining a target upgrade module from the to-be-upgraded modules;
[0030] Generating a module upgrade request of the target upgrade module and sending it to the server;
[0031] Receiving a differential upgrade package corresponding to the target upgrade module sent by the server, and upgrading the target upgrade module using the differential upgrade package.
[0032] In a third aspect, the embodiments of the present application further provide a differential upgrade system, comprising a server and a terminal.
[0033] The server is configured to: acquire original version files and upgrade version files corresponding to each functional module in the software system when receiving an upgrade request for the software system sent by the terminal; perform differential comparison on the original version files and the upgrade version files corresponding to each functional module to determine to-be-upgraded modules from the plurality of functional modules, and generate a differential content mapping table corresponding to the software system based on the to-be-upgraded modules; send upgrade information of the to-be-upgraded modules to the terminal, receive a module upgrade request for a target upgrade module sent by the terminal in response, generate a differential upgrade package corresponding to the target upgrade module based on the differential content mapping table, and send the differential upgrade package to the terminal, so that the terminal performs differential upgrade on the target upgrade module by using the differential upgrade package.
[0034] The terminal is configured to: generate an upgrade request for the software system and send the upgrade request to the server in response to a user's upgrade operation on the software system; receive upgrade information of to-be-upgraded modules sent by the server and display the upgrade information of the to-be-upgraded modules, determine a target upgrade module from the to-be-upgraded modules in response to a user's selection operation on any to-be-upgraded module; generate a module upgrade request for the target upgrade module and send the module upgrade request to the server; receive a differential upgrade package corresponding to the target upgrade module sent by the server, and upgrade the target upgrade module by using the differential upgrade package.
[0035] In a fourth aspect, the embodiments of the present application further provide an electronic device, comprising a processor, a memory and a bus, the memory stores machine readable instructions executable by the processor, the processor and the memory communicate through the bus when the electronic device is running, and the machine readable instructions are executed by the processor to perform the steps of the differential upgrade method as described above.
[0036] In a fifth aspect, the embodiments of the present application further provide a computer readable storage medium, the computer readable storage medium stores a computer program, and the computer program is executed by a processor to perform the steps of the differential upgrade method as described above.
[0037] The differential upgrade method, the differential upgrade system, the device and the medium provided by the embodiment of the application, when the server receives the upgrade request of the software system sent by the terminal, the original version file and the upgrade version file corresponding to each function module in the software system are obtained; the server compares the original version file and the upgrade version file corresponding to each function module, determines the to-be-upgraded module from the plurality of function modules, and generates the differential content mapping table corresponding to the software system based on the to-be-upgraded module; the server sends the upgrade information of the to-be-upgraded module to the terminal, receives and responds to the module upgrade request of the target upgrade module sent by the terminal, generates the differential upgrade package corresponding to the target upgrade module based on the differential content mapping table; and the server sends the differential upgrade package to the terminal, so that the terminal performs differential upgrade on the target upgrade module by using the differential upgrade package.
[0038] The software system to be upgraded is divided into a plurality of independent function modules in the application, the to-be-upgraded module is determined by comparing the original version file and the upgrade version file of each function module. The user can independently select the target function module to be upgraded, the server generates a customized differential package containing a specific module according to the user selection, and the terminal does not need to be forced to accept all the contents in the entire differential package. The terminal only needs to download the modularized differential package selected by the user, thereby avoiding the bandwidth waste caused by downloading the entire differential package and reducing the occupation of the device storage space. Due to the reduction of the amount of data to be downloaded and installed, the time required for the upgrade process is also significantly shortened. The modularized design enables each function module to be updated independently, and also reduces the risk that the entire software system cannot be normally upgraded due to a problem of a single module.
[0039] In order to make the above-mentioned purposes, features and advantages of the application more obvious and easy to understand, the following preferred embodiments are specifically described below, and the accompanying drawings are described in detail as follows. BRIEF DESCRIPTION OF DRAWINGS
[0040] In order to more clearly illustrate the technical solutions of the embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some of the embodiments of the application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0041] Figure 1 The flowchart of the differential upgrade method provided by the embodiment of the application;
[0042] Figure 2 The flowchart of the differential upgrade method provided by another embodiment of the application;
[0043] Figure 3An effect schematic diagram of a terminal displaying upgrade information provided by an embodiment of the present application.
[0044] Figure 4 A structure schematic diagram of a differential upgrade system provided by an embodiment of the present application.
[0045] Figure 5 A structure schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0046] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the following will be combined with the accompanying drawings for the embodiments of the present application to make a clear and complete description of the technical solutions of the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the accompanying drawings can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments of the present application, every other embodiment obtained by a person skilled in the art without creative work falls within the scope of protection of the present application.
[0047] First, the application scenarios applicable to the present application are introduced. The present application can be applied to the technical field of device remote upgrade.
[0048] With the rapid development of the Internet of Things and smart devices, OTA (Over-The-Air) technology, as a technology for remotely updating software on devices through wireless networks, has been widely applied in the fields of smart phones, smart home devices, automotive electronic systems, etc. The main advantage of OTA technology is that it can realize remote maintenance and functional upgrade of devices without relying on physical connections, thereby improving the performance and security of devices.
[0049] It is found through research that the traditional OTA update method usually includes full upgrade and differential upgrade. Full upgrade refers to downloading the entire firmware or the entire new version of the software package to the device, completely replacing the old version. Although this method is simple and direct, it requires downloading a large amount of data, occupying a large amount of network bandwidth and storage space, especially in the case of limited device storage resources, which may cause a large burden. Differential upgrade is a more efficient update method, which only downloads the difference between the new and old versions, thereby reducing data transmission volume, shortening update time, and reducing the occupation of device resources.
[0050] However, even if the differential upgrade is adopted, the generated differential package can contain the update content of multiple functional modules. For users, it can not be necessary to update all functional modules, but only some of them are interested. The traditional differential upgrade method cannot meet this individualized demand, resulting in unnecessary waste of resources and time consumption.
[0051] Based on this, the embodiments of the present application provide a differential upgrade method to improve upgrade efficiency, reduce resource consumption and improve user experience.
[0052] Please refer to Figure 1 , Figure 1 A flowchart of a differential upgrade method provided by the embodiments of the present application. The differential upgrade method provided by the embodiments of the present application is applied to a server, as shown in Figure 1 The differential upgrade method comprises the following steps.
[0053] S101, when receiving the upgrade request for the software system sent by the terminal, obtaining the original version file and the upgrade version file corresponding to each functional module in the software system.
[0054] Here, the terminal can be a smart phone, a smart home device, or a car electronic system, etc., which is not limited by the present application. The software system can be the operating system of the terminal, responsible for controlling and coordinating the terminal; it can also be a certain application program in the terminal, a software developed to meet the various application needs of users, such as office software, games, professional software, etc.; which is not limited by the present application. For example, when the terminal is a smart phone, the software system can be the operating system of the smart phone, such as Android, iOS, HarmonyOS, etc., and the software system can also be a certain application program in the smart phone. The functional module refers to an independent unit or component designed to achieve a specific function. For example, when the software system is the operating system of the smart phone, the functional module can be a performance optimization module, a security patch module, and a UI update module, etc. When the software system is a certain application software in the smart phone, the functional module can be the user interface module, the network communication module and the data processing module of the application software, etc. The original version file refers to the version file currently running by the functional module. The upgrade version file refers to the new version file after the original version of the functional module is optimized in function, repaired in defect or added with new features.
[0055] For the above step S101, when receiving the upgrade request for the software system sent by the terminal, the software system is modularized and subdivided, and the original version file and the upgrade version file corresponding to each functional module in the software system are obtained. Here, the original version file and the upgrade version file are both image files of the software system, and the image is a complete file copy of the original version file and the upgrade version file of the functional module.
[0056] S102, compare the differences between the original version file and the upgraded version file corresponding to each functional module, determine the module to be upgraded from multiple functional modules, and generate a difference content mapping table corresponding to the software system based on the module to be upgraded.
[0057] Here, the module to be upgraded refers to the functional module that needs to be upgraded. The module to be upgraded can be determined by comparing the differences between the original version file and the upgrade version file. The difference content mapping table records the difference content, module identifier, module name, and other information for each module to be upgraded in the software system.
[0058] Regarding step S102 above, in specific implementation, the original version file and the upgraded version file corresponding to each functional module are compared for differences. The modules to be upgraded are identified from multiple functional modules; these are the modules that differ from the original version file and need to be upgraded. Then, a difference mapping table corresponding to the software system is generated based on the modules to be upgraded.
[0059] As an optional embodiment, regarding step S102 above, the step of comparing the differences between the original version file and the upgraded version file corresponding to each functional module to determine the module to be upgraded from multiple functional modules includes:
[0060] Step 1021: For each functional module, divide the original version file and the upgraded version file corresponding to the functional module according to the preset storage space size to obtain multiple original version storage blocks and multiple upgraded version storage blocks.
[0061] Here, the preset storage space size can be 512 bytes or 4KB, and this application does not specifically limit it. Each storage block can store a certain amount of data.
[0062] Regarding step 1021 above, in specific implementation, for each functional module, the original version file and the upgraded version file corresponding to the functional module are divided according to the preset storage space size to obtain multiple original version storage blocks and multiple upgraded version storage blocks.
[0063] Step 1022: For each upgraded version storage block, determine the storage block to be compared from multiple original version storage blocks based on the storage block identifier of the upgraded version storage block.
[0064] Since each divided storage block has a unique block identifier (Block ID), the corresponding block can be obtained through the block identifier. For step 1022, in a specific implementation, for each upgraded version storage block, the corresponding to-be-compared storage block is determined from the plurality of original version storage blocks based on the block identifier of the upgraded version storage block.
[0065] Step 1023: performing difference comparison on the upgraded version storage block and the to-be-compared storage block, and if it is determined that there is a difference between the upgraded version storage block and the to-be-compared storage block, determining the upgraded version storage block as a difference storage block and the function module as the to-be-upgraded module.
[0066] For step 1023, in a specific implementation, the upgraded version storage block and the corresponding to-be-compared storage block are compared, and if it is determined that there is a difference between the upgraded version storage block and the to-be-compared storage block, the upgraded version storage block is determined as a difference storage block, and the function module is determined as a to-be-upgraded module.
[0067] Specifically, for step 1023, the difference comparison between the upgraded version storage block and the to-be-compared storage block includes:
[0068] calculating a first hash value of the upgraded version storage block and a second hash value of the to-be-compared storage block; and if the first hash value is different from the second hash value, it is considered that there is a difference between the upgraded version storage block and the to-be-compared storage block.
[0069] For the above two steps, in a specific implementation, a first hash value of the upgraded version storage block and a second hash value of the to-be-compared storage block are calculated. Here, the hash value can be calculated by MD5 or SHA-1, which is not limited in the present application. Then, the first hash value of the upgraded version storage block is compared with the second hash value of the to-be-compared storage block, if the first hash value of the upgraded version storage block is the same as the second hash value of the to-be-compared storage block, it is considered that the data stored in the two storage blocks is the same. If the first hash value of the upgraded version storage block is different from the second hash value of the to-be-compared storage block, it is considered that there is a difference between the upgraded version storage block and the to-be-compared storage block. Please refer to Table 1, which is a storage block hash value comparison example table provided by the embodiment of the present application, as shown in Table 1, the to-be-compared storage block corresponding to the upgraded version storage block is determined through the block identifier of the upgraded version storage block, the hash values of the two storage blocks are calculated respectively and compared, if the hash values are the same, it is considered that the data stored in the two storage blocks is the same, if the hash values are different, it is considered that there is a difference between the two storage blocks.
[0070] Table 1: A storage block hash value comparison example table
[0071]
[0072] Further, for the above step S102, the difference content mapping table corresponding to the software system is generated based on the to-be-upgraded module, comprising:
[0073] A: For each to-be-upgraded module, the difference content of the difference storage block corresponding to the to-be-upgraded module is determined.
[0074] Here, the difference content of the difference storage block refers to the specific data change part between the storage blocks corresponding to the new and old versions of the file due to modification, addition or deletion. The core goal of determining these differences is to extract only the change part, rather than transmitting the entire block, thereby reducing the size of the upgrade package.
[0075] For the above step A, in specific implementation, for each to-be-upgraded module, since the upgrade version storage block that has differences with the original version has been determined as the difference storage block in the above step, the original version storage block corresponding to the difference storage block is determined according to the identifier of the difference storage block, and then the difference content between the two is determined by a difference calculation method. Here, the difference calculation method can choose binary difference method or structured difference method, which is not limited by the present application.
[0076] B: The module identifier corresponding to the to-be-upgraded module, the storage block identifier of the difference storage block corresponding to the to-be-upgraded module, and the difference content of the difference storage block corresponding to the to-be-upgraded module are stored in a mapping relationship to obtain the difference content mapping table.
[0077] For the above step B, in specific implementation, the module identifier corresponding to the to-be-upgraded module, the storage block identifier of the difference storage block corresponding to the to-be-upgraded module, and the difference content of the difference storage block corresponding to the to-be-upgraded module are stored in a mapping relationship, that is, the difference content mapping table. In this way, the mapping relationship between the functional module and the difference storage block is recorded in the difference content mapping table, that is, the position of the difference block in the functional module and the content of the difference block, and the difference content of the corresponding difference storage block can be directly determined from the difference content mapping table by the module identifier corresponding to the target upgrade module when generating the differential upgrade package corresponding to the target upgrade module. Please refer to Table 2, which is a difference content mapping example table provided by an embodiment of the present application, as shown in Table 2, the difference content mapping table can include the module identifier and module name corresponding to the to-be-upgraded module, the storage block identifier of the difference storage block, the difference content of the difference storage block, the identifier of the difference content, and the file name involved in the difference content.
[0078] Table 2: A difference content mapping example table
[0079]
[0080] Here, the differences between the original version file and the upgraded version file are all from the three types of operations on the file, i.e., modification, addition, and deletion of the upgraded version. The target version file of the module to be upgraded (ModuleID) involves modification of multiple files (FileName), and each file (FileName) involved records a mapping relationship (block_diffs) with the difference storage block (BlockID), which includes the difference content (diff_content) and the storage block identifier (block_id) of the difference storage block. Subsequent users can select the module to be upgraded, and then map the module identifier ModuleID of the module selected by the user to the specific difference content from the difference content mapping table to generate a new difference upgrade package.
[0081] S103, send the upgrade information of the module to be upgraded to the terminal, receive and respond to the module upgrade request of the target upgrade module sent by the terminal, and generate the difference upgrade package corresponding to the target upgrade module based on the difference content mapping table.
[0082] Here, the upgrade information of the module to be upgraded includes the module name, upgrade description, upgrade type, and size information of the module to be upgraded, which is not limited in this application.
[0083] For the above step S103, when the module to be upgraded that needs to be upgraded is determined, the upgrade information of the module to be upgraded is sent to the terminal. At this time, the terminal displays the upgrade information after receiving the upgrade information of the module to be upgraded, and the user can select the target upgrade module according to the upgrade requirement. The terminal can generate the module upgrade request of the target upgrade module according to the module selection result of the user and return it to the server. The server receives and responds to the module upgrade request of the target upgrade module sent by the terminal, and generates the difference upgrade package corresponding to the target upgrade module based on the difference content mapping table generated in the above step. The difference upgrade package is a data package that only contains the difference part of the new and old version files, which is used to upgrade the old version file to the new version by "patching" instead of transmitting the complete new file. Its core goal is to reduce data transmission and improve upgrade efficiency. The difference upgrade package contains the update package of the difference content, which can significantly reduce the size of the update package compared to full update, thereby reducing bandwidth consumption and storage occupation.
[0084] As an optional embodiment, for the above step S103, the difference upgrade package corresponding to the target upgrade module is generated based on the difference content mapping table, which includes:
[0085] Step 1031, based on the target module identifier corresponding to the target upgrade module, obtaining the difference content of the difference storage block corresponding to the target upgrade module from the difference content mapping table.
[0086] Since the difference content mapping table generated by the above steps stores the difference content of the difference storage block corresponding to each module to be upgraded, the difference content can be directly determined from the difference content mapping table through the target module identifier corresponding to the target upgrade module selected by the user. For the above step 1031, in specific implementation, the target module identifier corresponding to the target upgrade module selected by the user is obtained, and the difference content of the difference storage block corresponding to the target upgrade module is extracted from the difference content mapping table based on the target module identifier.
[0087] Step 1032, packing the difference content of the difference storage block corresponding to the target upgrade module to obtain the differential upgrade package corresponding to the target upgrade module.
[0088] For the above step 1032, after determining the difference content of the difference storage block corresponding to the target upgrade module from the difference content mapping table, the difference content of the difference storage block corresponding to the target upgrade module is packed, and the differential upgrade package corresponding to the target upgrade module is generated.
[0089] S104, sending the differential upgrade package to the terminal, so that the terminal uses the differential upgrade package to perform differential upgrade on the target upgrade module.
[0090] For the above step S104, in specific implementation, the generated differential upgrade package is sent to the terminal, and after the terminal receives the differential upgrade package, the target upgrade module is upgraded using the differential upgrade package. In this way, the user can independently select the functional module to be updated, generate a customized differential package according to the user's selection, and also avoid the waste of bandwidth caused by downloading the entire differential package by the terminal, and reduce the occupation of the terminal storage space.
[0091] As an optional embodiment, after the differential upgrade package is sent to the terminal, the differential upgrade method further includes:
[0092] I: calculating a third hash value corresponding to the differential upgrade package.
[0093] II: receiving a fourth hash value sent by the terminal, and comparing the third hash value with the fourth hash value to verify the differential upgrade package.
[0094] The fourth hash value is generated by the terminal based on the received differential upgrade package.
[0095] For the above step I-step II, in a specific implementation, after the server sends the differential upgrade package to the terminal, the third hash value corresponding to the differential upgrade package is calculated. The terminal also calculates the fourth hash value based on the received differential upgrade package at the same time of receiving the differential upgrade package, and returns the fourth hash value to the server. The server receives the fourth hash value sent by the terminal, and compares the third hash value with the fourth hash value. In this way, after generating and sending the differential upgrade package, the integrity of the sent differential upgrade package and the received differential upgrade package by the terminal is verified through the hash value.
[0096] The differential upgrade method provided by the embodiment of the application is applied to a server. First, when receiving an upgrade request for a software system sent by a terminal, the original version file and the upgrade version file corresponding to each function module in the software system are obtained. Then, the original version file and the upgrade version file corresponding to each function module are compared to determine a to-be-upgraded module from the plurality of function modules, and a differential content mapping table corresponding to the software system is generated based on the to-be-upgraded module. The upgrade information of the to-be-upgraded module is sent to the terminal, a module upgrade request for a target upgrade module sent by the terminal is received and responded to, and a differential upgrade package corresponding to the target upgrade module is generated based on the differential content mapping table. Finally, the differential upgrade package is sent to the terminal, so that the terminal performs differential upgrade on the target upgrade module by using the differential upgrade package.
[0097] The software system to be upgraded is divided into a plurality of independent function modules in the application, and the to-be-upgraded module is determined by comparing the original version file and the upgrade version file of each function module. The user can autonomously select a target function module to be upgraded, the server generates a customized differential package containing a specific module according to the user selection, and the terminal does not need to be forced to accept all the contents in the entire differential package. The terminal only needs to download the modularized differential package selected by the user, thereby avoiding the bandwidth waste caused by downloading the entire differential package and reducing the occupation of the device storage space. Since the amount of data to be downloaded and installed is reduced, the time required for the upgrade process is also significantly shortened. The modularized design enables each function module to be updated independently, and also reduces the risk that the entire software system cannot be normally upgraded due to a problem of a single module.
[0098] Please refer to Figure 2 , Figure 2 A flowchart of a differential upgrade method provided by another embodiment of the application. The differential upgrade method provided by another embodiment of the application is applied to a terminal, as shown in Figure 2 The differential upgrade method includes the following steps.
[0099] S201, in response to a user's upgrade operation on a software system, an upgrade request for the software system is generated and sent to a server.
[0100] In response to the user's upgrade operation on the software system, an upgrade request for the software system is generated and sent to the server.
[0101] S202, receiving the upgrade information of the to-be-upgraded module sent by the server, and displaying the upgrade information of the to-be-upgraded module, and determining a target upgrade module from the to-be-upgraded module in response to the user's selection operation on any to-be-upgraded module.
[0102] In response to the user's upgrade operation on the software system, an upgrade request for the software system is generated and sent to the server.
[0103] Please refer to Figure 3 , Figure 3 The effect diagram of the terminal displaying the upgrade information provided by the embodiment of the application. As shown in Figure 3 , taking the terminal as a smart phone and the software system selected by the user for upgrade as an application in the smart phone, Figure 3 the shaded part is the icon of the application, and the upgrade information of the to-be-upgraded module of the application can be displayed in the interface of the smart phone for upgrading the application. The name of each to-be-upgraded module is displayed in the form of an icon, and the user can select the module to be upgraded by clicking the icon. The upgrade description and file size of each to-be-upgraded module are also displayed below the interface, and the user can also select the module to be upgraded by clicking the module name of the to-be-upgraded module in the text information below.
[0104] S203, generating a module upgrade request for the target upgrade module and sending it to the server.
[0105] S204, receiving the target upgrade module corresponding to the differential upgrade package sent by the server, and upgrading the target upgrade module using the differential upgrade package.
[0106] In the step S203-S204, in a specific implementation, after the user selects the target upgrade module in the terminal, the terminal generates a module upgrade request of the target upgrade module and sends it to the server. The terminal receives the differential upgrade package corresponding to the target upgrade module sent by the server, and upgrades the target upgrade module by using the differential upgrade package.
[0107] The differential upgrade method provided by the embodiment of the application is applied to a terminal. First, in response to a user's upgrade operation on a software system, an upgrade request for the software system is generated and sent to a server. Upgrade information of a to-be-upgraded module sent by the server is received, and the upgrade information of the to-be-upgraded module is displayed. In response to a user's selection operation on any to-be-upgraded module, a target upgrade module is determined from the to-be-upgraded module. A module upgrade request of the target upgrade module is generated and sent to the server. A differential upgrade package corresponding to the target upgrade module sent by the server is received, and the target upgrade module is upgraded by using the differential upgrade package.
[0108] The software system to be upgraded is divided into a plurality of independent functional modules in the application. By comparing the original version file and the upgrade version file of each functional module, the to-be-upgraded module is determined. The user can autonomously select a target functional module to be upgraded. The server generates a customized differential package containing a specific module according to the user selection. The terminal does not need to be forced to accept all the contents in the entire differential package. The terminal only needs to download the modular differential package selected by the user, thereby avoiding the bandwidth waste caused by downloading the entire differential package and reducing the occupation of the device storage space. Since the amount of data to be downloaded and installed is reduced, the time required for the upgrade process is also significantly shortened. The modular design enables each functional module to be updated independently, and also reduces the risk that the entire software system cannot be normally upgraded due to a problem of a single module.
[0109] Please refer to Figure 4 , Figure 4 The structure diagram of a differential upgrade system provided by the embodiment of the application is shown in FIG. 4. As shown in FIG. 4, the differential upgrade system 400 includes a server 401 and a terminal 402. Figure 4
[0110] The server 401 is configured to: when receiving an upgrade request for a software system sent by the terminal 402, acquire original version files and upgrade version files corresponding to each functional module in the software system; perform difference comparison on the original version files and the upgrade version files corresponding to each functional module to determine a to-be-upgraded module from the plurality of functional modules, and generate a difference content mapping table corresponding to the software system based on the to-be-upgraded module; send upgrade information of the to-be-upgraded module to the terminal 402, receive a module upgrade request for a target upgrade module sent by the terminal 402, generate a differential upgrade package corresponding to the target upgrade module based on the difference content mapping table, and send the differential upgrade package to the terminal 402, so that the terminal 402 performs differential upgrade on the target upgrade module by using the differential upgrade package.
[0111] The terminal 402 is configured to: in response to a user's upgrade operation on a software system, generate an upgrade request for the software system and send the upgrade request to the server 401; receive upgrade information of to-be-upgraded modules sent by the server 401, and display the upgrade information of the to-be-upgraded modules; in response to a user's selection operation on any to-be-upgraded module, determine a target upgrade module from the to-be-upgraded modules; generate a module upgrade request for the target upgrade module and send the module upgrade request to the server 401; receive a differential upgrade package corresponding to the target upgrade module sent by the server 401, and upgrade the target upgrade module by using the differential upgrade package.
[0112] Further, when the server 401 is configured to perform difference comparison on the original version files and the upgrade version files corresponding to each functional module to determine a to-be-upgraded module from the plurality of functional modules, the server 401 is further configured to:
[0113] For each functional module, the original version files and the upgrade version files corresponding to the functional module are respectively divided according to a preset storage space size, to obtain a plurality of original version storage blocks and a plurality of upgrade version storage blocks.
[0114] For each upgrade version storage block, a to-be-compared storage block corresponding to the upgrade version storage block is determined from the plurality of original version storage blocks based on a storage block identifier of the upgrade version storage block.
[0115] The upgrade version storage block and the to-be-compared storage block are compared for difference. If it is determined that there is a difference between the upgrade version storage block and the to-be-compared storage block, the upgrade version storage block is determined as a difference storage block, and the functional module is determined as the to-be-upgraded module.
[0116] Further, the server 401 is further configured to:
[0117] calculate a first hash value of the upgraded version storage block and a second hash value of the storage block to be compared;
[0118] if the first hash value is different from the second hash value, it is considered that there is a difference between the upgraded version storage block and the storage block to be compared.
[0119] Further, the server 401 is further configured to:
[0120] determine the difference content of the difference storage block corresponding to each module to be upgraded;
[0121] store the module identifier corresponding to the module to be upgraded, the storage block identifier of the difference storage block corresponding to the module to be upgraded, and the difference content of the difference storage block corresponding to the module to be upgraded in a mapping relationship to obtain the difference content mapping table.
[0122] Further, the server 401 is further configured to:
[0123] obtain the difference content of the difference storage block corresponding to the target upgrade module from the difference content mapping table based on the target module identifier corresponding to the target upgrade module;
[0124] pack the difference content of the difference storage block corresponding to the target upgrade module to obtain the differential upgrade package corresponding to the target upgrade module.
[0125] Further, the server 401 is further configured to:
[0126] calculate a third hash value corresponding to the differential upgrade package;
[0127] receive a fourth hash value sent by the terminal 402, and compare the third hash value with the fourth hash value to verify the differential upgrade package, wherein the fourth hash value is generated by the terminal 402 based on the received differential upgrade package.
[0128] Please refer to Figure 5 , Figure 5 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. As shown in Figure 5As shown in FIG. 5, the electronic device 500 includes a processor 510, a memory 520 and a bus 530.
[0129] The memory 520 stores machine readable instructions executable by the processor 510, and when the electronic device 500 is running, the processor 510 communicates with the memory 520 through the bus 530. When the machine readable instructions are executed by the processor 510, the above-mentioned Figure 1 and Figure 2 The steps of the differential upgrading method in the method embodiment shown are described in detail in the method embodiment, which will not be repeated here.
[0130] The computer readable storage medium provided in the embodiments of the present application stores a computer program, and when the computer program is run by a processor, the steps of the differential upgrading method in the method embodiment shown can be executed. Figure 1 and Figure 2 The steps of the differential upgrading method in the method embodiment shown are described in detail in the method embodiment, which will not be repeated here.
[0131] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-mentioned system, device and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
[0132] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some communication interfaces, devices or units, and can be electrical, mechanical or other forms.
[0133] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. According to actual needs, some or all of the units can be selected to achieve the purpose of the embodiment scheme.
[0134] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit.
[0135] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a nonvolatile computer readable storage medium executable by a processor. Based on this understanding, the technical solutions of the present application essentially or the parts of the prior art that make contributions or parts of the technical solutions can be embodied in the form of software products. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0136] Finally, it should be noted that: the above-described embodiments are only specific embodiments of the present application, which are used to illustrate the technical solutions of the present application, but not to limit them. The protection scope of the present application is not limited thereto. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can make modifications or easily think of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed by the present application, or make equivalent replacements to some of the technical features. The modifications, changes or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method of differential upgrading, the method comprising: The differential upgrading method is applied to a server, and the differential upgrading method comprises: When receiving an upgrading request for a software system sent by a terminal, obtaining original version files and upgrading version files corresponding to each functional module in the software system; Differentially comparing the original version files and the upgrading version files corresponding to each functional module to determine a to-be-upgraded module from the plurality of functional modules, and generating a differential content mapping table corresponding to the software system based on the to-be-upgraded module; Sending upgrading information of the to-be-upgraded module to the terminal, receiving and responding to a module upgrading request for a target upgrading module sent by the terminal, and generating a differential upgrading package corresponding to the target upgrading module based on the differential content mapping table; Sending the differential upgrading package to the terminal to enable the terminal to perform differential upgrading on the target upgrading module using the differential upgrading package.
2. The method of differential upgrade of claim 1, wherein, The differential comparison of the original version files and the upgrading version files corresponding to each functional module to determine a to-be-upgraded module from the plurality of functional modules comprises: For each functional module, the original version files and the upgrading version files corresponding to the functional module are respectively divided according to a preset storage space size to obtain a plurality of original version storage blocks and a plurality of upgrading version storage blocks; For each upgrading version storage block, a to-be-compared storage block corresponding to the upgrading version storage block is determined from the plurality of original version storage blocks based on a storage block identifier of the upgrading version storage block; The upgrading version storage block and the to-be-compared storage block are differentially compared, and if it is determined that there is a difference between the upgrading version storage block and the to-be-compared storage block, the upgrading version storage block is determined as a differential storage block, and the functional module is determined as the to-be-upgraded module.
3. The method of differential upgrade of claim 2, wherein, The differential comparison of the upgrading version storage block and the to-be-compared storage block comprises: A first hash value of the upgrading version storage block and a second hash value of the to-be-compared storage block are calculated; If the first hash value and the second hash value are not the same, it is considered that there is a difference between the upgrading version storage block and the to-be-compared storage block.
4. The method of differential upgrade of claim 2, wherein, The generation of the differential content mapping table corresponding to the software system based on the to-be-upgraded module comprises: For each to-be-upgraded module, the differential content of the differential storage block corresponding to the to-be-upgraded module is determined; The module identifier corresponding to the to-be-upgraded module, the storage block identifier of the differential storage block corresponding to the to-be-upgraded module, and the differential content of the differential storage block corresponding to the to-be-upgraded module are stored in a mapping relationship to obtain the differential content mapping table.
5. The method of differential upgrade of claim 4, wherein, The generation of the differential upgrading package corresponding to the target upgrading module based on the differential content mapping table comprises: The differential content of the differential storage block corresponding to the target upgrading module is obtained from the differential content mapping table based on a target module identifier corresponding to the target upgrading module; The differential content of the differential storage block corresponding to the target upgrading module is packaged to obtain the differential upgrading package corresponding to the target upgrading module.
6. The method of differential upgrade of claim 1, wherein, After the differential upgrading package is sent to the terminal, the differential upgrading method further comprises: A third hash value corresponding to the differential upgrading package is calculated; receive the fourth hash value sent by the terminal, and compare the third hash value with the fourth hash value to verify the differential upgrade package; wherein the fourth hash value is generated by the terminal based on the received differential upgrade package.
7. A method of differential upgrading, characterized by, The differential upgrade method is applied to a terminal; and the differential upgrade method comprises: In response to a user's upgrade operation on a software system, generating an upgrade request for the software system and sending the upgrade request to a server; receiving upgrade information of the to-be-upgraded module sent by the server, and displaying the upgrade information of the to-be-upgraded module, and determining a target upgrade module from the to-be-upgraded module in response to a user's selection operation on any to-be-upgraded module; generating a module upgrade request of the target upgrade module and sending the module upgrade request to the server; receiving a differential upgrade package corresponding to the target upgrade module sent by the server, and upgrading the target upgrade module by using the differential upgrade package.
8. A differential upgrade system, characterized by, The differential upgrade system comprises a server and a terminal. The server is configured to, when receiving an upgrade request for a software system sent by a terminal, acquire original version files and upgrade version files corresponding to each functional module in the software system; compare the original version files and the upgrade version files corresponding to each functional module, determine to-be-upgraded modules from a plurality of functional modules, and generate a differential content mapping table corresponding to the software system based on the to-be-upgraded modules; send upgrade information of the to-be-upgraded modules to the terminal, receive a module upgrade request of a target upgrade module sent by the terminal, and generate a differential upgrade package corresponding to the target upgrade module based on the differential content mapping table; send the differential upgrade package to the terminal, so that the terminal upgrades the target upgrade module by using the differential upgrade package; The terminal is configured to, in response to a user's upgrade operation on a software system, generate an upgrade request for the software system and send the upgrade request to a server. receive upgrade information of the to-be-upgraded module sent by the server, and display the upgrade information of the to-be-upgraded module, and determine a target upgrade module from the to-be-upgraded module in response to a user's selection operation on any to-be-upgraded module; generate a module upgrade request of the target upgrade module and send the module upgrade request to the server; receive a differential upgrade package corresponding to the target upgrade module sent by the server, and upgrade the target upgrade module by using the differential upgrade package.
9. An electronic device, comprising: comprise: a processor, a memory, and a bus, the memory storing machine-readable instructions executable by the processor, when the electronic device is running, the processor and the memory communicate through the bus, the machine-readable instructions are executed by the processor to perform the steps of the differential upgrade method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer program is stored on the computer readable storage medium, and the computer program is executed by the processor to perform the steps of the differential upgrade method according to any one of claims 1 to 7.