CN118227186B - Differential upgrading method, device, equipment, storage medium and program product - Google Patents
Differential upgrading method, device, equipment, storage medium and program product Download PDFInfo
- Publication number
- CN118227186B CN118227186B CN202410658232.XA CN202410658232A CN118227186B CN 118227186 B CN118227186 B CN 118227186B CN 202410658232 A CN202410658232 A CN 202410658232A CN 118227186 B CN118227186 B CN 118227186B
- Authority
- CN
- China
- Prior art keywords
- differential
- file
- files
- information
- ith
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 84
- 238000012545 processing Methods 0.000 claims abstract description 101
- 238000012795 verification Methods 0.000 claims abstract description 89
- 238000004422 calculation algorithm Methods 0.000 claims description 198
- 230000008569 process Effects 0.000 claims description 25
- 238000004590 computer program Methods 0.000 claims description 10
- 238000010586 diagram Methods 0.000 description 16
- 230000006870 function Effects 0.000 description 5
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012546 transfer Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000009467 reduction Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 239000002131 composite material Substances 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000005538 encapsulation Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
- G06F8/658—Incremental updates; Differential updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/50—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
- G06F21/57—Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
- G06F21/572—Secure firmware programming, e.g. of basic input output system [BIOS]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
- G06F8/63—Image based installation; Cloning; Build to order
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Health & Medical Sciences (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Stored Programmes (AREA)
Abstract
The embodiment of the application provides a differential upgrading method, a device, equipment, a storage medium and a program product, wherein the method comprises the following steps: acquiring a plurality of loading files in the differential upgrade package, wherein the loading files comprise registration information, license information and upgrade codes, determining a current firmware package of the target firmware, wherein the current firmware package comprises a plurality of current resource files, operating the upgrade codes to perform first verification processing on the license information, processing the plurality of current resource files and the plurality of differential files in the differential upgrade package respectively according to the registration information after the first verification processing on the license information is passed, determining an update firmware package, and upgrading the target firmware according to the update firmware package. By the method, the firmware upgrading efficiency of the equipment is improved.
Description
Technical Field
The embodiment of the application relates to the technical field of firmware upgrading, in particular to a differential upgrading method, a differential upgrading device, differential upgrading equipment, a differential upgrading storage medium and a differential upgrading program product.
Background
In the device, the firmware in the device can be upgraded in a differential upgrade mode. The differential upgrade is that the server generates a differential upgrade package by comparing the difference between the current version and the new version. The equipment to be upgraded realizes firmware upgrading by downloading and installing the differential upgrading package.
The differential upgrade package may include a plurality of differential files for recording differential information between the current version and the new version. The device to be upgraded can restore the plurality of differential files to the installation information of the new version and install the new version.
In the above process, since the restoration process of the differential file is implemented by the device to be upgraded, the server is required to generate the differential file compatible with the device to be upgraded, resulting in lower firmware upgrading efficiency of the device.
Disclosure of Invention
The embodiment of the application provides a differential upgrading method, a differential upgrading device, differential upgrading equipment, a storage medium and a program product, which are used for solving the defect of low firmware upgrading efficiency of equipment in the prior art.
In a first aspect, the present application provides a differential upgrade method, including:
Acquiring a plurality of loading files in a differential upgrade package, wherein the differential upgrade package is used for upgrading target firmware, and the plurality of loading files comprise registration information, license information and upgrade codes;
Determining a current firmware package of the target firmware, wherein the current firmware package comprises a plurality of current resource files;
running the upgrade code to perform a first verification process on the license information;
After the first verification processing of the license information is passed, respectively processing the current resource files and the differential files in the differential upgrade package according to the registration information to determine an updated firmware package;
and upgrading the target firmware according to the updated firmware package.
In one possible implementation manner, the upgrade code includes a plurality of differential algorithms, and according to the registration information, the plurality of current resource files and the plurality of differential files are respectively processed to determine an update firmware package, including:
According to the registration information, determining an ith differential file, an ith current resource file corresponding to the ith differential file and a target algorithm corresponding to the ith differential file, wherein the target algorithm is any one of the differential algorithms;
performing second check processing on the ith differential file according to the registration information;
after the second verification processing of the ith differential file is passed, determining an ith updated resource file according to the ith differential file, the ith current resource file and the target algorithm;
the update firmware package comprises a plurality of i-th update resource files, wherein i is 1,2, … … and N in sequence, and N is the number corresponding to the plurality of differential files.
In one possible implementation, determining an ith updated resource file according to the ith differential file, the ith current resource file, and the target algorithm includes:
Inputting the ith differential file and the ith current resource file into an algorithm corresponding to the ith differential file to obtain an ith resource file to be selected;
performing third verification processing on the ith resource file to be selected;
And deleting the ith current resource file after the third verification processing of the ith resource file to be selected is passed, and determining the ith resource file to be selected as the ith updated resource file.
In a possible implementation manner, the license information is used for recording the minimum running spaces corresponding to the multiple differential files, and the first verification processing is performed on the license information, which includes:
Acquiring the residual storage space of equipment where the target firmware is located;
judging whether the minimum running space corresponding to each of the plurality of differential files is smaller than the residual storage space or not;
if yes, determining that the first verification processing of the license information is passed;
if not, determining that the first verification processing of the license information is not passed.
In one possible implementation manner, after obtaining the plurality of loading files in the differential upgrade package, the method further includes:
respectively acquiring first signature information of the registration information, second signature information of the license information and third signature information corresponding to the upgrade code;
respectively carrying out security verification on the first signature information, the second signature information and the third signature information;
and determining that the security verification of the first signature information, the second signature information and the third signature information is passed.
In a second aspect, the present application provides a differential upgrade method, including:
Acquiring a current firmware package and an updated firmware package, wherein the updated firmware package is the firmware package updated by the initial firmware package, the current firmware package comprises a plurality of current resource files, and the updated firmware package comprises a plurality of updated resource files;
Performing differential processing on the plurality of current resource files and the plurality of updated resource files through a differential algorithm to obtain a plurality of differential files;
generating registration information according to the plurality of differential files and a differential algorithm used by each differential file;
generating license information according to the plurality of differential files;
Generating an upgrade code according to a differential algorithm used by each differential file;
And generating a differential upgrade package according to the plurality of differential files, the registration information, the license information and the upgrade code.
In a possible implementation manner, the current resource file corresponds to the updated resource file, and for any one current resource file, the difference processing is performed on the current resource file and the updated resource file through a difference algorithm to obtain a difference file, which includes:
determining a plurality of parameter operation ratios corresponding to each differential algorithm in a plurality of differential algorithms according to the current resource file and the updated resource file;
determining the scoring values respectively corresponding to a plurality of differential algorithms according to the parameter operation ratios;
determining a differential algorithm corresponding to the highest scoring value in the scoring values as a target algorithm;
And carrying out differential processing on the current resource file and the updated resource file according to the target algorithm to obtain a differential file.
In one possible implementation manner, for any one differential algorithm, determining a score value corresponding to the differential algorithm according to the multiple parameter operation ratios includes:
judging whether the running ratios of the parameters are smaller than or equal to a preset value;
If yes, determining a scoring value corresponding to the differential algorithm according to the multiple parameter operation ratios and the weight value corresponding to each parameter operation ratio;
if not, determining that the scoring value corresponding to the differential algorithm is 0.
In one possible implementation, generating registration information according to the plurality of differential files and a differential algorithm used by each differential file includes:
Acquiring a plurality of field heads corresponding to the registration information;
Determining field information corresponding to each field header according to the plurality of differential files and a differential algorithm used by each differential file;
and generating registration information according to the field heads and the field information corresponding to each field head.
In one possible implementation manner, generating license information according to the plurality of differential files includes:
sequentially determining the minimum running space corresponding to each differential file;
And generating license information according to the plurality of differential files and the minimum running space corresponding to each differential file.
In a third aspect, the present application provides a differential upgrade apparatus, comprising:
The device comprises an acquisition module, a storage module and a storage module, wherein the acquisition module is used for acquiring a plurality of loading files in a differential upgrade package, the differential upgrade package is used for upgrading target firmware, and the plurality of loading files comprise registration information, license information and upgrade codes;
the first determining module is used for determining a current firmware package of the target firmware, wherein the current firmware package comprises a plurality of current resource files;
The second determining module is used for running the upgrading code so as to perform first verification processing on the permission information; after the first verification processing of the license information is passed, respectively processing the current resource files and the differential files in the differential upgrade package according to the registration information to determine an updated firmware package;
and the upgrading module is used for upgrading the target firmware according to the updated firmware package.
In a possible implementation manner, the upgrade code includes a plurality of differential algorithms, and the second determining module is specifically configured to:
According to the registration information, determining an ith differential file, an ith current resource file corresponding to the ith differential file and a target algorithm corresponding to the ith differential file, wherein the target algorithm is any one of the differential algorithms;
performing second check processing on the ith differential file according to the registration information;
after the second verification processing of the ith differential file is passed, determining an ith updated resource file according to the ith differential file, the ith current resource file and the target algorithm;
the update firmware package comprises a plurality of i-th update resource files, wherein i is 1,2, … … and N in sequence, and N is the number corresponding to the plurality of differential files.
In one possible implementation, the second determining module is specifically configured to:
Inputting the ith differential file and the ith current resource file into an algorithm corresponding to the ith differential file to obtain an ith resource file to be selected;
performing third verification processing on the ith resource file to be selected;
And deleting the ith current resource file after the third verification processing of the ith resource file to be selected is passed, and determining the ith resource file to be selected as the ith updated resource file.
In a possible implementation manner, the license information is used for recording the minimum running spaces corresponding to the multiple differential files, and the second determining module is specifically configured to:
Acquiring the residual storage space of equipment where the target firmware is located;
judging whether the minimum running space corresponding to each of the plurality of differential files is smaller than the residual storage space or not;
if yes, determining that the first verification processing of the license information is passed;
if not, determining that the first verification processing of the license information is not passed.
In a possible implementation manner, the method further comprises a verification module, wherein the verification module is specifically configured to:
respectively acquiring first signature information of the registration information, second signature information of the license information and third signature information corresponding to the upgrade code;
respectively carrying out security verification on the first signature information, the second signature information and the third signature information;
and determining that the security verification of the first signature information, the second signature information and the third signature information is passed.
In a fourth aspect, the present application provides a differential upgrade apparatus, including:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a current firmware package and an updated firmware package, the updated firmware package is the firmware package after the initial firmware package is updated, the current firmware package comprises a plurality of current resource files, and the updated firmware package comprises a plurality of updated resource files;
the first determining module is used for carrying out differential processing on the plurality of current resource files and the plurality of updated resource files through a differential algorithm to obtain a plurality of differential files;
the second determining module is used for generating registration information according to the plurality of differential files and the differential algorithm used by each differential file;
a third determining module, configured to generate license information according to the plurality of differential files;
The fourth determining module is used for generating an upgrade code according to a differential algorithm used by each differential file;
And the generating module is used for generating a differential upgrade package according to the plurality of loading files and the plurality of differential files.
In one possible implementation manner, the current resource file corresponds to the updated resource file one by one, and for any one current resource file, the first determining module is specifically configured to:
determining a plurality of parameter operation ratios corresponding to each differential algorithm in a plurality of differential algorithms according to the current resource file and the updated resource file;
determining the scoring values respectively corresponding to a plurality of differential algorithms according to the parameter operation ratios;
determining a differential algorithm corresponding to the highest scoring value in the scoring values as a target algorithm;
And carrying out differential processing on the current resource file and the updated resource file according to the target algorithm to obtain a differential file.
In one possible implementation manner, for any one of the differential algorithms, the first determining module is specifically configured to:
judging whether the running ratios of the parameters are smaller than or equal to a preset value;
If yes, determining a scoring value corresponding to the differential algorithm according to the multiple parameter operation ratios and the weight value corresponding to each parameter operation ratio;
if not, determining that the scoring value corresponding to the differential algorithm is 0.
In one possible implementation, the second determining module is specifically configured to:
Acquiring a plurality of field heads corresponding to the registration information;
Determining field information corresponding to each field header according to the plurality of differential files and a differential algorithm used by each differential file;
and generating registration information according to the field heads and the field information corresponding to each field head.
In one possible implementation, the second determining module is specifically configured to:
sequentially determining the minimum running space corresponding to each differential file;
And generating license information according to the plurality of differential files and the minimum running space corresponding to each differential file.
In a fifth aspect, the present application provides a differential upgrade apparatus, comprising: a processor, and a memory communicatively coupled to the processor;
The memory stores computer-executable instructions;
The processor executes computer-executable instructions stored in the memory to implement the method of any one of the first aspects.
In a sixth aspect, the present application provides a differential upgrade apparatus, comprising: a processor, and a memory communicatively coupled to the processor;
The memory stores computer-executable instructions;
The processor executes computer-executable instructions stored in the memory to implement the method of any of the second aspects.
In a seventh aspect, the present application provides a computer readable storage medium having stored therein computer executable instructions for implementing the method according to any of the first aspects when executed by a processor.
In an eighth aspect, the present application provides a computer-readable storage medium having stored therein computer-executable instructions for performing the method of any of the second aspects when executed by a processor.
In a ninth aspect, the present application provides a computer program product comprising a computer program which, when executed by a computer, implements the method according to any of the first aspects.
In a tenth aspect, the present application provides a computer program product comprising a computer program which, when executed by a computer, implements the method according to any of the second aspects.
The differential upgrading method, the device, the equipment, the storage medium and the program product provided by the embodiment of the application are characterized in that a plurality of loading files in a differential upgrading package are obtained, the differential upgrading package is used for upgrading a target firmware, the loading files comprise registration information, license information and upgrading codes, a current firmware package of the target firmware is determined, the current firmware package comprises a plurality of current resource files, the upgrading codes are operated so as to carry out first verification processing on the license information, after the first verification processing on the license information is passed, the differential files in the current resource files and the differential upgrading package are respectively processed according to the registration information, the updating firmware package is determined, and the target firmware is upgraded according to the updating firmware package. Therefore, the differential upgrading can be realized no matter what type of differential file is in the equipment to be upgraded, so that the firmware upgrading efficiency of the equipment is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the drawings that are needed in the embodiments or the description of the prior art will be briefly described below, it will be obvious that the drawings in the following description are some embodiments of the present invention, and that other drawings can be obtained according to these drawings without inventive effort to a person skilled in the art.
FIG. 1 is a schematic flow chart of a conventional differential upgrade according to an embodiment of the present application;
fig. 2 is a schematic flow chart of a differential upgrading method according to an embodiment of the present application;
FIG. 3 is a schematic flow chart of another differential upgrade method according to an embodiment of the present application;
FIG. 4 is a flow chart of another differential upgrade method according to an embodiment of the present application;
FIG. 5 is a schematic diagram of differential file generation according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a differential upgrade package according to an embodiment of the present application;
FIG. 7 is a schematic flow chart of another differential upgrade method according to an embodiment of the present application;
Fig. 8 is a schematic structural diagram of a differential upgrade apparatus according to an embodiment of the present application;
Fig. 9 is a schematic structural diagram of another differential upgrade apparatus according to an embodiment of the present application;
Fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Specific embodiments of the present application have been shown by way of the above drawings and will be described in more detail below. The drawings and the written description are not intended to limit the scope of the inventive concepts in any way, but rather to illustrate the inventive concepts to those skilled in the art by reference to the specific embodiments.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
It should be noted that although the terms "first", "second", etc. are used to describe various information in the embodiments of the present application, the information should not be limited to these terms. These terms are only used to distinguish one type of information from another. Alternatively, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information, without departing from the scope of the application.
It should be understood that the terms "comprises" and "comprising" specify the presence of stated features, steps, operations, but do not preclude the presence, addition, or addition of one or more other features, steps, operations. The term "and/or" and the like as used herein may be construed as inclusive, or meaning any one or any combination. Alternatively, "a and/or B" means "any of the following: a, A is as follows; b, a step of preparing a composite material; a and B). In addition, the character "/" herein generally indicates that the front-rear association object is an "or" relationship.
In the device, the firmware in the device can be upgraded in a differential upgrade mode. The differential upgrade is to generate a differential upgrade package by comparing the difference between the current version and the new version. The device to be upgraded realizes firmware upgrade by downloading and installing the differential upgrade package.
Next, a description will be given of a conventional differential upgrading process with reference to fig. 1.
Fig. 1 is a schematic flow chart of a conventional differential upgrade according to an embodiment of the present application. Referring to fig. 1, fig. 1 may include a server 101 and a device to be upgraded 102.
A communication connection may be established between the server 101 and the device to be upgraded 102. For example, the server 101 may establish a communication connection with the device 102 to be upgraded through a hypertext transfer protocol (hyper text tansfer protocol, HTTP) or a hypertext transfer protocol over secure socket layer (hyper text transfer trotocol over secure socket layer, HTTPs) or the like, which is not specifically limited herein.
Wherein a database may be provided in the server 101, and the database may include a first version firmware image package and a second version firmware image package. The first version of the firmware image package may be a firmware image package currently running in the device to be upgraded 102, and the second version of the firmware image package may be a firmware image package to be upgraded in the device to be upgraded 102. The server 101 may make a differential upgrade package of the firmware in the device to be upgraded 102 according to the first version firmware image package and the second version firmware image package. The server 101 may also send a differential upgrade package to the device to be upgraded 102. The differential upgrade package may include a plurality of differential files for recording differential information between versions.
The server 101 may be a cloud server, a server of a distributed system, or a server combined with a blockchain, which is not particularly limited herein.
The device to be upgraded 102 may include a restore program. The device to be upgraded 102 may receive the differential upgrade packet, and perform reduction processing on the differential upgrade packet through a plurality of differential algorithms in the reduction program, so as to generate a second version firmware image packet, so as to implement differential upgrade.
The device to be upgraded 102 may be any type of terminal, for example, may include a mobile phone, a computer, a tablet, a wearable device, a webcam, and the like, and the embodiment of the present application does not specifically limit the device to be upgraded 102.
In the above process, since the restoration process of the differential file is implemented by the device to be upgraded, the server is required to generate the differential file compatible with the device to be upgraded, resulting in lower firmware upgrading efficiency of the device.
In order to solve the technical problems described above, an embodiment of the present application provides a differential upgrade method, which obtains a plurality of load files in a differential upgrade package, and processes the plurality of differential files in the differential upgrade package according to the plurality of load files, so as to obtain an updated firmware package for upgrade processing. Therefore, the differential upgrading can be realized no matter what type of differential file is in the equipment to be upgraded, so that the firmware upgrading efficiency of the equipment is improved.
The technical scheme shown in the application is described in detail by specific examples. It should be noted that the following embodiments may exist independently or may be combined with each other, and for the same or similar content, the description will not be repeated in different embodiments.
Fig. 2 is a schematic flow chart of a differential upgrading method according to an embodiment of the present application. The execution body of the embodiment of the application can be terminal equipment or a client arranged in the terminal equipment. The client may be implemented by software, or may be implemented by a combination of software and hardware. Referring to fig. 2, the method includes:
s201, acquiring a plurality of loading files in the differential upgrade package.
The differential upgrade package may be used to upgrade a target firmware, which may be firmware to be upgraded in the terminal device. The differential upgrade package may include a plurality of differential files and a plurality of load files.
A plurality of differential files may be used to record differential information between the current firmware package and the updated firmware package. The current firmware package may be a firmware package corresponding to the current running firmware of the terminal device. The update firmware package may be a firmware package corresponding to the firmware that needs to be updated by the terminal device.
Multiple load files may be used to control multiple differential files for differential upgrades. The plurality of load files may include registration information, license information, and an upgrade code.
Multiple load files in the differential upgrade package may be obtained in response to an upgrade instruction sent by the server. The upgrade instruction may be used to instruct the terminal device to perform an upgrade operation.
Alternatively, the plurality of loading files in the differential upgrade package may be acquired through a streaming download manner.
The streaming downloading refers to downloading a plurality of files in the differential upgrade package into the terminal equipment in a streaming manner.
Optionally, after the differential upgrade package of the target firmware is acquired, security verification may be performed on the plurality of loading files in the following manner: respectively acquiring first signature information of registration information, second signature information of license information and third signature information corresponding to an upgrade code; respectively carrying out security verification on the first signature information, the second signature information and the third signature information; and determining that the security verification of the first signature information, the second signature information and the third signature information is passed.
S202, determining a current firmware package of the target firmware.
The current firmware package may be stored in the terminal device. The current firmware package may include a plurality of current resource files therein. The plurality of current resource files can be used for recording the resource files corresponding to the current running firmware of the terminal equipment.
The current firmware package of the target firmware may be determined in the memory space of the terminal device.
For example, the name of the target firmware is abc, and the current firmware package abc1.2.1 may be determined according to abc.
S203, running an upgrade code to perform first verification processing on the license information.
The upgrade code may be used to record program code that restores the plurality of differencing files.
The upgrade code may include third signature information, program code for decrypting, program code for invoking a plurality of differential restoration algorithms, and the like.
The encapsulation format of the upgrade code may be compatible with the system of the terminal device, and the upgrade code may be run in the system of the terminal device.
Running the upgrade code may be used to execute a processing script corresponding to the upgrade code to perform the corresponding processing steps.
The license information may be used to record device object information corresponding to the update firmware package.
The device object information may include second signature information, first identification information of a current firmware package, a running environment of a current operating system, a minimum memory space at a time of a plurality of differential file restore operations, a minimum flash memory space at a time of a plurality of differential file restore operations, and the like.
The first verification process may be used to verify the security of the license information.
The upgrade code may be run to verify the first identification information of the current firmware package in the license information to determine the security of the license information.
S204, after the first verification processing of the license information is passed, processing the current resource files and the differential files in the differential upgrade package according to the registration information, and determining an updated firmware package.
Registration information may be used to record the differential pair information for each of the named files in the current firmware package and the updated firmware package. The differential pair information may include differential information of the first signature information plurality of differential files. The differential information of each differential file may include a differential file name, hash information of a current resource file, a file length of the current resource file, hash information of an updated resource file, a file length of the updated resource file, hash information of the differential file, a file length of the differential file, a secure encryption manner of the differential file, differential algorithm information, and the like.
The differential algorithm information may include a differential algorithm name, an old version file of a file directory, a differential file of a file directory, a restored file of a file directory, and may further include a loading mode and at least one verification mode, which are not limited herein. The loading mode can comprise file stream loading and all file loading. The verification means may include verifying patch data, verifying old version data, and the like.
The differential file may correspond to a current resource file, where the current resource file may be empty.
The current resource file being empty may indicate that there is no current resource file corresponding to the updated resource file in the current firmware package, i.e., the updated resource file is a new added file. Correspondingly, the differential file may represent differential information of the updated resource file and the empty file, that is, differential processing is performed on the updated resource file to obtain the differential file.
The update firmware package may include a plurality of update resource files.
After the first verification process of the license information is passed, the plurality of current resource files and the plurality of differential files are respectively processed according to the registration information and the plurality of differential algorithms to restore a plurality of updated resource files.
S205, upgrading the target firmware according to the updated firmware package.
The device state of the terminal device can be determined, if the device state is an upgradeable state, the target firmware is upgraded according to the updated firmware package, the upgrading result of the terminal device is verified, and after the upgrading result passes, the completion of the upgrading is determined.
According to the differential upgrading method provided by the embodiment, the plurality of loading files in the differential upgrading package are obtained, the differential upgrading package is used for upgrading the target firmware, the plurality of loading files comprise registration information, license information and upgrading codes, the current firmware package of the target firmware is determined, the current firmware package comprises a plurality of current resource files, the upgrading codes are operated to perform first verification processing on the license information, after the first verification processing on the license information is passed, the plurality of current resource files and the plurality of differential files are respectively processed according to the registration information, the updating firmware package is determined, and the target firmware is upgraded according to the updating firmware package. Therefore, the differential upgrading can be realized no matter what type of differential file is in the equipment to be upgraded, so that the firmware upgrading efficiency of the equipment is improved.
Fig. 3 is a flow chart of another differential upgrading method according to an embodiment of the present application. On the basis of the above embodiment, the method will be described in detail with reference to fig. 3. The method comprises the following steps:
s301, acquiring a plurality of loading files in the differential upgrade package.
The execution of S301 may refer to the execution of S201, and will not be described herein.
S302, respectively acquiring first signature information of registration information, second signature information of license information and third signature information corresponding to upgrading codes.
The first signature information may be used to secure the registration information. The second signature information may be used to secure license information and the third signature information may be used to secure upgrade code.
Signature fields corresponding to the registration information, the license information and the upgrade code respectively can be determined, and according to the signature fields, first signature information of the registration information, second signature information of the license information and third signature information corresponding to the upgrade code are obtained respectively.
S303, carrying out security verification on the first signature information, the second signature information and the third signature information respectively.
Wherein the security verification may employ an asymmetric encryption algorithm.
For example, the first signature information may be encrypted information encrypted by the server with the public key, the terminal device may decrypt the encrypted information by the private key, and determine whether the decrypted information is consistent with the verification information, and if so, determine that the security verification is passed; if the security verification is inconsistent, the security verification is determined to not pass.
The first signature information, the second signature information and the third signature information can be respectively subjected to security verification through an asymmetric encryption algorithm.
S304, determining that the security verification of the first signature information, the second signature information and the third signature information is passed.
The security verification results corresponding to the first signature information, the second signature information and the third signature information respectively can be determined, and the security verification results of the first signature information, the second signature information and the third signature information are determined to be the security verification passing results.
S305, determining the current firmware package of the target firmware.
The execution of S305 may refer to the execution of S202, and will not be described herein.
S306, running the upgrade code to obtain the residual storage space of the equipment where the target firmware is located.
The remaining storage space may include a remaining memory space and a remaining flash memory space.
The upgrade code can be operated to obtain the actual identification information of the current firmware package, whether the first identification information in the license information is matched with the actual identification information is judged, and if yes, the remaining storage space of the equipment where the target firmware is located is obtained.
S307, judging whether the minimum running space corresponding to each of the plurality of differential files is smaller than the residual storage space.
If not, executing S308;
If yes, execution proceeds to S309.
The license information is used for recording the minimum running space corresponding to each of the plurality of differential files.
If at least one differential file exists in the plurality of differential files and the corresponding minimum running space is larger than the remaining storage space, S308 is executed; if the minimum running space corresponding to any one of the plurality of differential files is smaller than the remaining storage space, S309 is executed.
S308, determining that the first verification process of the license information is not passed.
And if the first verification process of the license information is determined not to pass, determining that the target firmware upgrade fails.
S309, the first verification process of determining the license information passes.
After S309, S310 is performed.
The first verification process of determining the license information is passed, so that it can be ensured that each differential file in the differential upgrade package can reliably run in the terminal device.
S310, initializing i to be 1.
S311, determining an ith differential file, an ith current resource file corresponding to the ith differential file and a target algorithm corresponding to the ith differential file according to the registration information.
The target algorithm is any one of a plurality of differential algorithms.
The registration information may include first signature information and differential information of the plurality of differential files.
For example, registration information may be represented by the following code:
“RegSign”: “rsa2048:4ac7dc54ela58b7d1……”,
“RegDiff”:{
{“Name”: “uImage”,
“Compare”: “Bsdiffv1.0.0Args:-f”,
“oldsize”: “115200”,
“NewSize”: “238900”,
“Diffsize”: “565”,
“oldHash”: “sha256:9d94fffff984ff8a5b7b223a3a4a789f7……”,
“NewHash”:“sha256:273b1215be17107ae08b9923d2695……”,
“DiffHash”: “sha256:30f6ee73£09644c276969decb4915d……”,
“Encrypt”: “aes128”}
……
Wherein, "RegSign" may represent first signature information, "RegDiff" may represent differential information of a differential file, "Name" represents a differential file Name, "computer" represents differential algorithm information, "oldsize" represents a file length of a current resource file, "NewSize" represents a file length of an updated resource file, "Diffsize" represents a file length of a differential file, "oldHash" represents hash information of a current resource file, "NewHash" represents hash information of an updated resource file, "DiffHash" represents hash information of a differential file, "Encrypt" represents a secure encryption manner of a differential file.
The method comprises the steps of downloading an ith differential file according to the sequence of a plurality of differential files in registration information, determining an ith current resource file corresponding to the ith differential file according to the differential file names in the registration information, and determining a target algorithm corresponding to the ith differential file according to differential algorithm information in the registration information.
S312, performing second checking processing on the ith differential file according to the registration information.
The second verification process may be used to verify the security of the i-th differential file.
The method comprises the steps of decrypting an ith differential file according to a secure encryption mode in registration information, and after decrypting the ith differential file, performing second verification processing on the ith differential file and the ith current resource file according to the file length of the current resource file, the file length of the differential file, hash information of the current resource file and hash information of the differential file in the registration information.
Alternatively, the second verification process may be performed on the i-th differential file by: determining the actual differential file length and the actual differential hash information corresponding to the i differential file, and the actual current resource file length and the actual current resource hash information corresponding to the i current resource file, comparing the actual differential file length with the file length of the differential file in the registration information, comparing the actual differential hash information with the hash information of the differential file in the registration information, comparing the actual current resource file length with the file length of the current resource file in the registration information, and comparing the actual current resource hash information with the hash information of the current resource in the registration information; if the comparison results are all comparison matching, determining that the second check processing is passed, and if any comparison result is comparison unmatched, determining that the second check processing is not passed.
And when the second verification processing fails, determining that the target firmware upgrade fails.
S313, after the second verification processing of the ith differential file is passed, determining an ith updated resource file according to the ith differential file, the ith current resource file and the target algorithm.
After the second verification processing of the ith differential file is passed, determining an algorithm interface of the target algorithm, inputting the ith differential file and the ith current resource file into the algorithm interface, and determining the ith updated resource file.
Alternatively, the ith updated resource file may be determined according to the ith differential file, the ith current resource file, and the target algorithm in the following manner: inputting the ith differential file and the ith current resource file into an algorithm corresponding to the ith differential file to obtain an ith resource file to be selected; performing third verification processing on the ith resource file to be selected; and deleting the ith current resource file after the third verification processing of the ith resource file to be selected is passed, and determining the ith resource file to be selected as the ith updated resource file.
Wherein the third verification process may be used to determine the security of the ith candidate resource file.
Optionally, the third verification process may be performed on the i-th candidate resource file in the following manner: determining the actual file length and the actual hash information corresponding to the ith resource file to be selected, comparing the actual file length with the file length of the updated resource file in the registration information, and comparing the actual hash information with the hash information of the updated resource file in the registration information; if the comparison results are all comparison matching, determining that the third check processing is passed, and if any comparison result is comparison unmatched, determining that the third check processing is not passed.
And when the third verification process fails, determining that the target firmware upgrade fails.
S314, updating i to i+1, and judging whether i+1 is larger than N.
If yes, then execute S315;
If not, S311 is performed.
Wherein N may be the number corresponding to the plurality of differential files. N update resource files may be included in the update firmware package.
S315, upgrading the target firmware according to the updated firmware package.
The execution of S315 may refer to the execution of S205, and will not be described herein.
The implementation content of each step in the embodiment of the present application may refer to the description of the corresponding step or operation in the above method embodiment, and repeated descriptions are omitted.
According to the differential upgrading method provided by the embodiment, a plurality of loading files in a differential upgrading package are obtained, the differential upgrading package is used for upgrading target firmware, the plurality of loading files comprise registration information, license information and upgrading codes, a current firmware package of the target firmware is determined, the current firmware package comprises a plurality of current resource files, the upgrading codes are operated to obtain the residual storage space of equipment where the target firmware is located, whether the minimum operation space corresponding to the plurality of differential files is smaller than the residual storage space or not is judged, after the first verification processing of the license information is passed, the ith current resource file corresponding to the ith differential file and a target algorithm corresponding to the ith differential file are determined according to the registration information, the target algorithm is any one of the plurality of differential algorithms, the second verification processing is carried out on the ith differential file according to the registration information, after the second verification processing of the ith differential file is passed, the ith updated resource file is determined according to the ith differential file, the ith current resource file and the target algorithm, and the i updated resource file is sequentially 1,2, … …, N and N are the number of the corresponding differential files, and the target firmware package is updated according to the update processing. Therefore, the differential upgrading can be realized no matter what type of differential file is in the equipment to be upgraded, so that the firmware upgrading efficiency of the equipment is improved.
Fig. 4 is a flow chart of another differential upgrading method according to an embodiment of the present application. The execution subject of the embodiment of the application can be a server. The server may be implemented by a combination of software and hardware. Referring to fig. 4, the method includes:
S401, acquiring a current firmware package and updating the firmware package.
The update firmware package may be a firmware package after the initial firmware package is updated, where the current firmware package includes a plurality of current resource files, and the update firmware package includes a plurality of update resource files. The plurality of current resource files may correspond to a plurality of updated resource files.
The target firmware to be upgraded can be determined, and the current firmware package and the updated firmware package are acquired according to the target firmware.
S402, performing differential processing on a plurality of current resource files and a plurality of updated resource files through a differential algorithm to obtain a plurality of differential files.
The differential algorithm may be plural and different differential algorithms may have different differential restoration conditions.
The updated resource file may be the same as or different from the current resource file. When the updated resource file is the same as the current resource file, the differential file is empty; when the updated resource file is different from the current resource file, the differential file may represent difference information of the updated resource file and the current resource file.
For any updated resource file, whether a target current resource file corresponding to the updated resource file exists or not can be judged from a plurality of current resource files, if not, a target algorithm can be determined from a plurality of differential algorithms according to the updated resource file, and differential processing is carried out on the updated resource file according to the target algorithm to obtain a differential file; if the updated resource file is the same as the target current resource file, determining a target algorithm in a plurality of differential algorithms, and performing differential processing on the updated resource file and the target current resource file according to the target algorithm to obtain a differential file; if the difference files are the same, the difference files are determined to be empty.
Next, with reference to fig. 5, a process of differentiating the plurality of current resource files and the plurality of updated resource files by a differentiating algorithm to obtain a plurality of differential files will be illustrated.
Fig. 5 is a schematic diagram of differential file generation according to an embodiment of the present application. Referring to fig. 5, fig. 5 may include a plurality of current resource files, a plurality of updated resource files, and a plurality of differential files.
The plurality of current resource files may include current resource file1, current resource files 2, … …, current resource file n. The plurality of update resource files may include update resource file1, update resource files 2, … …, update resource file n. The plurality of differential files may include differential file1, differential files 2, … …, differential file n.
Wherein the current resource file 1 corresponds to the updated resource file 1, … …, and the current resource file n corresponds to the updated resource file n.
Differential file 1, … … may be generated from current resource file 1 and updated resource file 1, and differential file n may be generated from current resource file n and updated resource file n.
Wherein, assuming that the current resource file 3 is empty, the differential file 3 may be generated according to the current resource file 3 and the updated resource file 3 that are empty.
Assuming that the current resource file 4 is the same as the updated resource file 4, the differential file 4 may be generated as an empty differential file from the current resource file 4 and the updated resource file 4.
S403, generating registration information according to the plurality of differential files and the differential algorithm used by each differential file.
Initial information corresponding to the registration information can be determined, a plurality of pieces of sub-information corresponding to the initial information are determined according to the plurality of differential files and the differential algorithm used by each differential file, and the plurality of pieces of sub-information are combined with the initial information to generate the registration information.
The initial information may be used to represent a structure of the registration information, and the sub information may be specific information corresponding to each structure.
Alternatively, the registration information may be generated by: acquiring a plurality of field heads corresponding to the registration information; determining field information corresponding to each field header according to the plurality of differential files and a differential algorithm used by each differential file; and generating registration information according to the field heads and the field information corresponding to each field head.
Wherein the field header may be used to represent an attribute of the corresponding field information.
For example, the field header may be RegSign, regDiff or the like, where "RegSign" may represent first signature information and "RegDiff" may represent differential information of the differential file.
S404, generating license information according to the plurality of differential files.
The first identification information of the current firmware package may be determined, and license information may be generated based on the plurality of differential files and the first identification information.
Alternatively, the license information may be generated as follows: sequentially determining the minimum running space corresponding to each differential file; and generating license information according to the plurality of differential files and the minimum running space corresponding to each differential file.
The minimum running space may include a minimum memory running space and a minimum flash memory running space.
S405, generating an upgrade code according to a differential algorithm used by each differential file.
At least one differential algorithm corresponding to the plurality of differential files can be determined, algorithm interfaces respectively corresponding to the at least one differential algorithm are determined according to the at least one differential algorithm, and an upgrade code is generated according to the at least one algorithm interface.
S406, generating a differential upgrade package according to the plurality of differential files, the registration information, the license information and the upgrade codes.
The differential upgrade package may be used to upgrade a target firmware, which may be firmware to be upgraded in a terminal device to be upgraded.
The differential files, registration information, license information and upgrade codes may be encapsulated to generate a differential upgrade package.
Next, with reference to fig. 6, the structure of the differential upgrade package is illustrated.
Fig. 6 is a schematic structural diagram of a differential upgrade package according to an embodiment of the present application. Referring to fig. 6, fig. 6 may include a plurality of load files and a plurality of differential files, the plurality of load files may include registration information, license information, and an upgrade code, and the plurality of differential files may include differential file 1, differential files 2, … …, and differential file n.
The implementation content of each step in the embodiment of the present application may refer to the description of the corresponding step or operation in the above method embodiment, and repeated descriptions are omitted.
According to the differential upgrading method provided by the embodiment, the current firmware package and the updated firmware package are obtained, the updated firmware package is the firmware package after the initial firmware package is upgraded, the current firmware package comprises a plurality of current resource files, the updated firmware package comprises a plurality of updated resource files, the current resource files and the updated resource files are subjected to differential processing through a differential algorithm to obtain a plurality of differential files, registration information is generated according to the differential files and the differential algorithm used by each differential file, license information is generated according to the differential files, upgrading codes are generated according to the differential algorithm used by each differential file, and the differential upgrading package is generated according to the differential files, the registration information, the license information and the upgrading codes. Therefore, the differential upgrading can be realized no matter what type of differential file is in the equipment to be upgraded, so that the firmware upgrading efficiency of the equipment is improved.
Next, with reference to fig. 7, a process (S402) of performing differential processing on the current resource file and the updated resource file by using a differential algorithm with respect to any one of the current resource files, where the current resource file corresponds to the updated resource file, to obtain a differential file is further described.
Fig. 7 is a flow chart of another differential upgrading method according to an embodiment of the present application. On the basis of the above embodiment, the method will be described in detail with reference to fig. 7. The method comprises the following steps:
S701, determining a plurality of parameter operation ratios corresponding to each differential algorithm in a plurality of differential algorithms according to the current resource file and the updated resource file.
The plurality of differential algorithms may be server-supported algorithms.
The plurality of parameter operating ratios may include a time operating ratio, a memory operating ratio, a flash operating ratio, a CPU operating ratio, and the like. The parametric operating ratio may be a ratio of actual operating data to restricted operating data of the differential algorithm.
The time operation ratio may be a ratio of an actual operation duration of the differential algorithm to an operation duration threshold. The memory running ratio may be a ratio of an actual memory running ratio of the differential algorithm to a memory threshold. The flash run ratio may be the ratio of the actual flash run ratio of the differential algorithm to the flash threshold. The CPU running ratio may be a ratio of CPU actual consumption data to a CPU consumption threshold.
Aiming at any differential algorithm, differential processing is carried out on the current resource file and the updated resource file through the differential algorithm, and a plurality of parameter operation ratios corresponding to the differential algorithm are determined.
S702, determining the scoring values respectively corresponding to the differential algorithms according to the operation ratios of the parameters.
The scoring value may be used to represent the processing performance of the differencing algorithm. The higher the score value, the higher the processing performance.
The weight values corresponding to the parameter operation ratios can be obtained, and the scoring values corresponding to the differential algorithms are determined according to the parameter operation ratios and the weight values corresponding to the parameter operation ratios.
Optionally, for any one differential algorithm, the scoring value corresponding to the differential algorithm may be determined according to a plurality of parameter operation ratios by: judging whether the running ratios of the parameters are smaller than or equal to a preset value; if yes, determining a scoring value corresponding to the differential algorithm according to a plurality of parameter operation ratios and weight values corresponding to each parameter operation ratio; if not, determining that the scoring value corresponding to the differential algorithm is 0.
The scoring value corresponding to the differential algorithm may be determined according to a plurality of parameter operation ratios and weight values corresponding to each parameter operation ratio in the following manner: the products of the running ratios of the parameters and the corresponding weight values can be respectively determined, and the products are added to be determined as scoring values corresponding to the differential algorithm.
For example, the plurality of parameter operating ratios includes a time operating ratioMemory operation ratioFlash memory operation ratioCPU running ratio. The weight value of the time operation ratio isThe weight value of the memory operation ratio isThe weight value of the flash memory operation ratio isThe weight value of the CPU running ratio is。
First judge、、AndWhether less than or equal to a preset value of 1. If not, determining that the score value corresponding to the differential algorithm is 0; if yes, determining a scoring value S corresponding to the differential algorithm through the following formula:
S703, determining a differential algorithm corresponding to the highest scoring value in the scoring values as a target algorithm.
The target algorithm may be the most efficient algorithm to generate a certain differential file.
And the differential algorithm corresponding to the score value of 0 can be removed, at least one differential algorithm to be selected is determined, and the differential algorithm to be selected with the highest score value is determined as the target algorithm in the at least one differential algorithm to be selected.
For example, there are m algorithms, and m algorithm corresponding scoring values may be determined separately:。
the target algorithm S' may be:
where MAX may be a maximum function.
S704, carrying out differential processing on the current resource file and the updated resource file according to a target algorithm to obtain a differential file.
The differential processing may be differential processing performed by a target algorithm.
A target algorithm can be adopted, differential data is calculated according to the current resource file and the updated resource file, and a differential file is generated according to the differential data.
The implementation content of each step in the embodiment of the present application may refer to the description of the corresponding step or operation in the above method embodiment, and repeated descriptions are omitted.
According to the differential upgrading method provided by the embodiment, a plurality of parameter operation ratios corresponding to each differential algorithm are determined in a plurality of differential algorithms according to the current resource file and the updated resource file, the grading values corresponding to the differential algorithms are determined according to the parameter operation ratios, the differential algorithm corresponding to the highest grading value in the grading values is determined as a target algorithm, and differential processing is performed on the current resource file and the updated resource file according to the target algorithm, so that the differential file is obtained. Therefore, the server can determine the optimal algorithm from a plurality of differential algorithms according to the current resource file and the updated resource file, and perform differential upgrading according to the optimal algorithm so as to improve the firmware upgrading efficiency of the equipment.
In one possible implementation, the plurality of load files may include registration information, license information, and an upgrade code.
Fig. 8 is a schematic structural diagram of a differential upgrade apparatus according to an embodiment of the present application. Referring to fig. 8, the apparatus 800 includes an acquisition module 801, a first determination module 802, a second determination module 803, and an upgrade module 804, wherein,
An obtaining module 801, configured to obtain a plurality of load files in a differential upgrade package, where the differential upgrade package is used to upgrade a target firmware, and the plurality of load files include registration information, license information, and an upgrade code;
a first determining module 802, configured to determine a current firmware package of the target firmware, where the current firmware package includes a plurality of current resource files;
a second determining module 803, configured to run the upgrade code to perform a first verification process on the license information; after the first verification processing of the license information is passed, respectively processing the current resource files and the differential files in the differential upgrade package according to the registration information to determine an updated firmware package;
And the upgrading module 804 is configured to upgrade the target firmware according to the updated firmware package.
In a possible implementation manner, the upgrade code includes a plurality of differential algorithms, and the second determining module 803 is specifically configured to:
According to the registration information, determining an ith differential file, an ith current resource file corresponding to the ith differential file and a target algorithm corresponding to the ith differential file, wherein the target algorithm is any one of the differential algorithms;
performing second check processing on the ith differential file according to the registration information;
after the second verification processing of the ith differential file is passed, determining an ith updated resource file according to the ith differential file, the ith current resource file and the target algorithm;
the update firmware package comprises a plurality of i-th update resource files, wherein i is 1,2, … … and N in sequence, and N is the number corresponding to the plurality of differential files.
In one possible implementation, the second determining module 803 is specifically configured to:
Inputting the ith differential file and the ith current resource file into an algorithm corresponding to the ith differential file to obtain an ith resource file to be selected;
performing third verification processing on the ith resource file to be selected;
And deleting the ith current resource file after the third verification processing of the ith resource file to be selected is passed, and determining the ith resource file to be selected as the ith updated resource file.
In a possible implementation manner, the license information is used to record the minimum running spaces corresponding to the multiple differential files, and the second determining module 803 is specifically configured to:
Acquiring the residual storage space of equipment where the target firmware is located;
judging whether the minimum running space corresponding to each of the plurality of differential files is smaller than the residual storage space or not;
if yes, determining that the first verification processing of the license information is passed;
if not, determining that the first verification processing of the license information is not passed.
In a possible implementation manner, the method further comprises a verification module 805, where the verification module 805 is specifically configured to:
respectively acquiring first signature information of the registration information, second signature information of the license information and third signature information corresponding to the upgrade code;
respectively carrying out security verification on the first signature information, the second signature information and the third signature information;
and determining that the security verification of the first signature information, the second signature information and the third signature information is passed.
Fig. 9 is a schematic structural diagram of another differential upgrade apparatus according to an embodiment of the present application. Referring to fig. 9, the apparatus 900 includes an acquisition module 901, a first determination module 902, a second determination module 903, a third determination module 904, a fourth determination module 905, and a generation module 906, wherein,
The obtaining module 901 is configured to obtain a current firmware package and an updated firmware package, where the updated firmware package is a firmware package after the initial firmware package is updated, the current firmware includes a plurality of current resource files, and the updated firmware package includes a plurality of updated resource files;
A first determining module 902, configured to perform differential processing on the plurality of current resource files and the plurality of updated resource files through a differential algorithm, so as to obtain a plurality of differential files;
A second determining module 903, configured to generate registration information according to the plurality of differential files and a differential algorithm used by each differential file;
a third determining module 904, configured to generate license information according to the plurality of differential files;
A fourth determining module 905, configured to generate an upgrade code according to a differential algorithm used by each differential file;
The generating module 906 is configured to generate a differential upgrade package according to the plurality of loading files and the plurality of differential files.
In a possible implementation manner, the current resource file corresponds to the updated resource file one to one, and for any one current resource file, the first determining module 902 is specifically configured to:
determining a plurality of parameter operation ratios corresponding to each differential algorithm in a plurality of differential algorithms according to the current resource file and the updated resource file;
determining the scoring values respectively corresponding to a plurality of differential algorithms according to the parameter operation ratios;
determining a differential algorithm corresponding to the highest scoring value in the scoring values as a target algorithm;
And carrying out differential processing on the current resource file and the updated resource file according to the target algorithm to obtain a differential file.
In one possible implementation, for any one of the differential algorithms, the first determining module 902 is specifically configured to:
judging whether the running ratios of the parameters are smaller than or equal to a preset value;
If yes, determining a scoring value corresponding to the differential algorithm according to the multiple parameter operation ratios and the weight value corresponding to each parameter operation ratio;
if not, determining that the scoring value corresponding to the differential algorithm is 0.
In one possible implementation, the second determining module 903 is specifically configured to:
Acquiring a plurality of field heads corresponding to the registration information;
Determining field information corresponding to each field header according to the plurality of differential files and a differential algorithm used by each differential file;
and generating registration information according to the field heads and the field information corresponding to each field head.
In one possible implementation, the second determining module 903 is specifically configured to:
sequentially determining the minimum running space corresponding to each differential file;
And generating license information according to the plurality of differential files and the minimum running space corresponding to each differential file.
Fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application. Referring to fig. 10, the electronic device 1000 may include: memory 1001, processor 1002, transceiver 1003.
Memory 1001 is used to store program instructions;
the processor 1002 is configured to execute the program instructions stored in the memory, so as to cause the electronic device 1000 to perform the method described above.
The transceiver 1003 may include: a transmitter and/or a receiver. The transmitter may also be referred to as a transmitter, a transmit port, a transmit interface, or the like, and the receiver may also be referred to as a receiver, a receive port, a receive interface, or the like. The memory 1001, the processor 1002, and the transceiver 1003 are illustratively interconnected by a bus 1004.
Embodiments of the present application also provide a computer program product executable by a processor for implementing the above method when the computer program product is executed.
The differential upgrading device, the electronic device, the computer readable storage medium and the computer program product in the embodiment of the application can execute the technical scheme shown in the embodiment of the differential upgrading method, and the implementation principle and the beneficial effects are similar, and are not repeated here.
All or part of the steps for implementing the method embodiments described above may be performed by hardware associated with program instructions. The foregoing program may be stored in a readable memory. The program, when executed, performs steps including the method embodiments described above; and the aforementioned memory (storage medium) includes: read-only memory (ROM), random-access memory (random access memory, RAM), flash memory, hard disk, solid state disk, magnetic tape (MAGNETIC TAPE), floppy disk (floppy disk), optical disk (optical disk), and any combination thereof.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-executable instructions. These computer-executable instructions may be provided to a processing unit of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer-executable instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer-executable instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various modifications and variations can be made to the embodiments of the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the embodiments of the present application fall within the scope of the claims and the equivalents thereof, the present application is also intended to include such modifications and variations.
Claims (12)
1. A differential upgrade method, comprising:
acquiring a plurality of loading files in a differential upgrade package, wherein the differential upgrade package is used for upgrading target firmware, the loading files comprise registration information, license information and upgrade codes, the registration information is used for recording the difference ratio pair information of each homonymous file in a current firmware package and an updated firmware package, and the license information is used for recording equipment object information corresponding to the updated firmware package; the upgrade code includes program code for invoking a plurality of differential restoration algorithms;
Determining a current firmware package of the target firmware, wherein the current firmware package comprises a plurality of current resource files;
running the upgrade code to perform a first verification process on the license information;
After the first verification processing of the license information is passed, respectively processing the current resource files and the differential files in the differential upgrade package according to the registration information to determine an updated firmware package;
Upgrading the target firmware according to the updated firmware package;
The upgrade code comprises a plurality of differential algorithms, and according to the registration information, the upgrade code respectively processes the plurality of current resource files and a plurality of differential files in the differential upgrade package to determine an update firmware package, and comprises the following steps:
According to the registration information, determining an ith differential file, an ith current resource file corresponding to the ith differential file and a target algorithm corresponding to the ith differential file, wherein the target algorithm is any one of the differential algorithms;
performing second check processing on the ith differential file according to the registration information;
after the second verification processing of the ith differential file is passed, determining an ith updated resource file according to the ith differential file, the ith current resource file and the target algorithm;
the update firmware package comprises a plurality of i-th update resource files, wherein i is 1,2, … … and N in sequence, and N is the number corresponding to the plurality of differential files.
2. The method of claim 1, wherein determining an ith updated resource file based on the ith differential file, the ith current resource file, and the target algorithm comprises:
Inputting the ith differential file and the ith current resource file into an algorithm corresponding to the ith differential file to obtain an ith resource file to be selected;
performing third verification processing on the ith resource file to be selected;
And deleting the ith current resource file after the third verification processing of the ith resource file to be selected is passed, and determining the ith resource file to be selected as the ith updated resource file.
3. The method according to claim 1 or 2, wherein the license information is used for recording the minimum running spaces corresponding to the plurality of differential files, and performing a first verification process on the license information includes:
Acquiring the residual storage space of equipment where the target firmware is located;
judging whether the minimum running space corresponding to each of the plurality of differential files is smaller than the residual storage space or not;
if yes, determining that the first verification processing of the license information is passed;
if not, determining that the first verification processing of the license information is not passed.
4. The method according to claim 1 or 2, further comprising, after obtaining the plurality of load files in the differential upgrade package:
respectively acquiring first signature information of the registration information, second signature information of the license information and third signature information corresponding to the upgrade code;
respectively carrying out security verification on the first signature information, the second signature information and the third signature information;
and determining that the security verification of the first signature information, the second signature information and the third signature information is passed.
5. A differential upgrade method, comprising:
Acquiring a current firmware package and an updated firmware package, wherein the updated firmware package is a firmware package after the initial firmware package is updated, the current firmware package comprises a plurality of current resource files, and the updated firmware package comprises a plurality of updated resource files;
Performing differential processing on the plurality of current resource files and the plurality of updated resource files through a differential algorithm to obtain a plurality of differential files;
generating registration information according to the plurality of differential files and the differential algorithm used by each differential file, wherein the registration information is used for recording the differential ratio pair information of each homonymous file in the current firmware package and the updated firmware package;
Generating license information according to the plurality of differential files, wherein the license information is used for recording and updating equipment object information corresponding to the firmware package, and the equipment object information comprises at least one of first identification information of the current firmware package and a minimum running space corresponding to each differential file;
generating an upgrade code according to a differential algorithm used by each differential file, wherein the upgrade code comprises a program code for calling a plurality of differential restoration algorithms;
Generating a differential upgrade package according to the plurality of differential files, the registration information, the license information and the upgrade code;
the generating an upgrade code according to the differential algorithm used by each differential file comprises the following steps:
Determining at least one differential algorithm corresponding to the plurality of differential files;
determining algorithm interfaces respectively corresponding to the at least one differential algorithm according to the at least one differential algorithm;
Generating the upgrade code according to at least one algorithm interface.
6. The method of claim 5, wherein the current resource file corresponds to the updated resource file, and wherein the performing differential processing on the current resource file and the updated resource file by using a differential algorithm for any one of the current resource files to obtain a differential file comprises:
determining a plurality of parameter operation ratios corresponding to each differential algorithm in a plurality of differential algorithms according to the current resource file and the updated resource file;
determining the scoring values respectively corresponding to a plurality of differential algorithms according to the parameter operation ratios;
determining a differential algorithm corresponding to the highest scoring value in the scoring values as a target algorithm;
And carrying out differential processing on the current resource file and the updated resource file according to the target algorithm to obtain a differential file.
7. The method of claim 6, wherein for any one of the differential algorithms, determining a score value corresponding to the differential algorithm according to the plurality of parameter operating ratios, comprises:
judging whether the running ratios of the parameters are smaller than or equal to a preset value;
If yes, determining a scoring value corresponding to the differential algorithm according to the multiple parameter operation ratios and the weight value corresponding to each parameter operation ratio;
if not, determining that the scoring value corresponding to the differential algorithm is 0.
8. A differential upgrade apparatus, the apparatus comprising:
The device comprises an acquisition module, a storage module and a storage module, wherein the acquisition module is used for acquiring a plurality of loading files in a differential upgrade package, the differential upgrade package is used for upgrading target firmware, the plurality of loading files comprise registration information, license information and upgrade codes, the upgrade codes comprise program codes for calling a plurality of differential restoration algorithms, the registration information is used for recording difference ratio pair information of each homonymous file in a current firmware package and an updated firmware package, and the license information is used for recording device object information corresponding to the updated firmware package;
the first determining module is used for determining a current firmware package of the target firmware, wherein the current firmware package comprises a plurality of current resource files;
the second determining module is used for running the upgrading code to perform first verification processing on the license information, and after the first verification processing of the license information is passed, the plurality of current resource files and a plurality of differential files in the differential upgrading package are respectively processed according to the registration information to determine an updated firmware package;
The updating module is used for updating the target firmware according to the updating firmware package;
The upgrade code comprises a plurality of differential algorithms, and the second determining module is specifically configured to determine, according to the registration information, an ith differential file, an ith current resource file corresponding to the ith differential file, and a target algorithm corresponding to the ith differential file, where the target algorithm is any one of the plurality of differential algorithms; performing second check processing on the ith differential file according to the registration information; after the second verification processing of the ith differential file is passed, determining an ith updated resource file according to the ith differential file, the ith current resource file and the target algorithm; the update firmware package comprises a plurality of i-th update resource files, wherein i is 1, 2, … … and N in sequence, and N is the number corresponding to the plurality of differential files.
9. A differential upgrade apparatus, the apparatus comprising:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a current firmware package and an updated firmware package, the updated firmware package is a firmware package after the initial firmware package is updated, the current firmware package comprises a plurality of current resource files, and the updated firmware package comprises a plurality of updated resource files;
the first determining module is used for carrying out differential processing on the plurality of current resource files and the plurality of updated resource files through a differential algorithm to obtain a plurality of differential files;
The second determining module is used for generating registration information according to the plurality of differential files and the differential algorithm used by each differential file, wherein the registration information is used for recording the differential ratio pair information of each homonymous file in the current firmware package and the updated firmware package;
the third determining module is used for generating license information according to the plurality of differential files, wherein the license information is used for recording equipment object information corresponding to the updated firmware package, and the equipment object information comprises at least one of first identification information of the current firmware package and a minimum running space corresponding to each differential file;
a fourth determining module, configured to generate an upgrade code according to a differential algorithm used by each differential file, where the upgrade code includes program code for calling a plurality of differential restoration algorithms;
the generation module is used for generating a differential upgrade package according to the plurality of differential files, the registration information, the license information and the upgrade code;
The fourth determining module is specifically configured to determine at least one differential algorithm corresponding to the plurality of differential files; determining algorithm interfaces respectively corresponding to the at least one differential algorithm according to the at least one differential algorithm; generating the upgrade code according to at least one algorithm interface.
10. An electronic device, comprising: a processor, and a memory communicatively coupled to the processor;
The memory stores computer-executable instructions;
The processor executes computer-executable instructions stored in the memory to implement the method of any one of claims 1 to 4 or any one of claims 5 to 7.
11. A computer readable storage medium having stored therein computer executable instructions which when executed by a processor are for implementing the method of any one of claims 1 to 4 or any one of claims 5 to 7.
12. A computer program product comprising a computer program which, when executed by a processor, implements the method of any one of claims 1 to 4 or any one of claims 5 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410658232.XA CN118227186B (en) | 2024-05-27 | 2024-05-27 | Differential upgrading method, device, equipment, storage medium and program product |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410658232.XA CN118227186B (en) | 2024-05-27 | 2024-05-27 | Differential upgrading method, device, equipment, storage medium and program product |
Publications (2)
Publication Number | Publication Date |
---|---|
CN118227186A CN118227186A (en) | 2024-06-21 |
CN118227186B true CN118227186B (en) | 2024-08-27 |
Family
ID=91507940
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410658232.XA Active CN118227186B (en) | 2024-05-27 | 2024-05-27 | Differential upgrading method, device, equipment, storage medium and program product |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118227186B (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117632211A (en) * | 2022-08-19 | 2024-03-01 | 荣耀终端有限公司 | Application program updating method, electronic device and readable medium |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10101992B2 (en) * | 2015-06-15 | 2018-10-16 | Lear Corporation | Telematics control unit comprising a differential update package |
CN111857790A (en) * | 2020-07-23 | 2020-10-30 | 北京自如信息科技有限公司 | Firmware upgrading method and device and computer equipment |
CN113721967B (en) * | 2021-08-30 | 2024-07-05 | 苏州磐联集成电路科技股份有限公司 | Differential packet generation method, differential packet generation device, and upgrade method |
CN114416154A (en) * | 2022-01-25 | 2022-04-29 | 上海艾拉比智能科技有限公司 | Memory self-adaptive differential upgrading method |
CN114780127A (en) * | 2022-05-09 | 2022-07-22 | 乐鑫信息科技(上海)股份有限公司 | Embedded equipment firmware updating method, embedded equipment and development end equipment |
CN115309422A (en) * | 2022-07-19 | 2022-11-08 | 东风汽车集团股份有限公司 | Vehicle-mounted program upgrading method, device, equipment and medium |
CN117908939A (en) * | 2022-10-18 | 2024-04-19 | 蔚来移动科技有限公司 | Application program upgrading method, computer readable storage medium and electronic equipment |
CN115718614A (en) * | 2022-11-25 | 2023-02-28 | 北京亚华物联科技发展有限公司 | Block differential upgrade package generation and block differential upgrade method and device |
CN117608627A (en) * | 2023-12-05 | 2024-02-27 | 瑞芯微电子股份有限公司 | Method for upgrading firmware, electronic device and storage medium |
-
2024
- 2024-05-27 CN CN202410658232.XA patent/CN118227186B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117632211A (en) * | 2022-08-19 | 2024-03-01 | 荣耀终端有限公司 | Application program updating method, electronic device and readable medium |
Also Published As
Publication number | Publication date |
---|---|
CN118227186A (en) | 2024-06-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10715335B2 (en) | Methods and apparatus to provide for efficient and secure software updates | |
US20210209373A1 (en) | Media authentication using distributed ledger | |
US9325506B2 (en) | Cryptographically enforcing strict separation of environments | |
CN109862099B (en) | Upgrade checking method, device, terminal and system | |
US11977637B2 (en) | Technique for authentication and prerequisite checks for software updates | |
CN101316168B (en) | Authentification device and method | |
JP2012234563A (en) | Static file system differencing and updating | |
CN109634615B (en) | Issuing method, verification method and device of application installation package | |
CN111008034B (en) | Patch generation method and device | |
CN107239299B (en) | Plug-in upgrading method and device | |
CN112866195B (en) | Agile data transmission method and device, computer equipment and storage medium | |
US20050154899A1 (en) | Mobile software authentication and validation | |
CN113841141A (en) | Provisioning of protocol content for installation of encrypted packets | |
CN114143197B (en) | OTA (over the air) upgrading method, device and equipment for Internet of things equipment and readable storage medium | |
CN112311528A (en) | Data secure transmission method based on state cryptographic algorithm | |
CN111399867A (en) | Software upgrading method, device, equipment and computer readable storage medium | |
CN118227186B (en) | Differential upgrading method, device, equipment, storage medium and program product | |
CN111400771A (en) | Target partition checking method and device, storage medium and computer equipment | |
CN110851821A (en) | Android intelligent device APK safety management and control method | |
CN111046389A (en) | Method for securely updating firmware components and portable computer station for implementation | |
CN112559546B (en) | Database synchronization method, database synchronization device, computer equipment and readable storage medium | |
CN111427607A (en) | Configuration file repair method, device and computer-readable storage medium | |
CN114281379A (en) | Software updating method and device based on OTA, equipment terminal, server terminal and storage medium | |
CN110825406A (en) | Software upgrading method and related equipment | |
CN111061495A (en) | Application installation method, terminal device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |