CN107239299B - Plug-in upgrading method and device - Google Patents

Plug-in upgrading method and device Download PDF

Info

Publication number
CN107239299B
CN107239299B CN201710296360.4A CN201710296360A CN107239299B CN 107239299 B CN107239299 B CN 107239299B CN 201710296360 A CN201710296360 A CN 201710296360A CN 107239299 B CN107239299 B CN 107239299B
Authority
CN
China
Prior art keywords
plug
information
verification information
upgrade package
verification
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
Application number
CN201710296360.4A
Other languages
Chinese (zh)
Other versions
CN107239299A (en
Inventor
赵路平
赵聪颖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing 58 Information Technology Co Ltd
Original Assignee
Beijing 58 Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing 58 Information Technology Co Ltd filed Critical Beijing 58 Information Technology Co Ltd
Priority to CN201710296360.4A priority Critical patent/CN107239299B/en
Publication of CN107239299A publication Critical patent/CN107239299A/en
Application granted granted Critical
Publication of CN107239299B publication Critical patent/CN107239299B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • G06F21/575Secure boot

Abstract

The invention provides a plug-in upgrading method and device. The plug-in upgrading method comprises the following steps: acquiring an upgrade package corresponding to a first plug-in; the upgrade package comprises a delta file and verification information, the delta file comprises difference information of the first plug-in and the second plug-in, and a position of the difference information in a first data file of the second plug-in; the second plug-in is the latest version plug-in corresponding to the first plug-in; verifying the upgrade package according to the verification information to obtain a verification passing result; and upgrading according to the upgrading packet and the first plug-in to obtain the upgraded first plug-in. The plug-in upgrading method and device have the advantages of high plug-in upgrading speed and no consumption of user flow.

Description

Plug-in upgrading method and device
Technical Field
The present invention relates to communications engineering technologies, and in particular, to a method and an apparatus for upgrading a plug-in.
Background
With the increasing functions of android applications, installation packages become larger, and a plug-in mechanism is used by many Application programs (APPs). The plug-in mechanism has the advantages of dynamic updating, no need of installation, reduction of the storage space occupied by the main program and the like.
The dynamic update method of the plug-in the prior art comprises the following steps: modifying program codes of Dalvik execution program (DEX for short) files in a plug-in package in a server, thereby adding functions and/or repairing BUGs, obtaining a new complete plug-in package, and uploading the new complete plug-in package to the server as an upgrade package of the plug-in. And the terminal downloads the upgrade package, and replaces the current plug-in package with the upgrade package to finish the upgrade of the plug-in.
However, for a plug-in which occupies a large storage space, when the number of BUGs is small or the modification of functions is small, the terminal needs to download an upgrade package to complete the upgrade process, and the upgrade package is a complete plug-in package, which may cause problems of slow update speed and consumption of user traffic.
Disclosure of Invention
The invention provides a plug-in upgrading method and device, which aim to solve the technical problems of low plug-in upgrading speed and user flow consumption caused by a large upgrading packet in the prior art.
In a first aspect, the present invention provides a plug-in upgrading method, applied to a terminal device, where a first plug-in is installed in the terminal device, and the method includes:
acquiring an upgrade package corresponding to the first plug-in; the upgrade package comprises a delta file and verification information, the delta file comprising difference information for the first and second plug-ins and a location of the difference information in a first data file of the second plug-in; the second plug-in is the latest version plug-in corresponding to the first plug-in;
verifying the upgrade package according to the verification information to obtain a verification passing result;
and upgrading according to the upgrading packet and the first plug-in to obtain the upgraded first plug-in.
In the above method, the upgrading according to the upgrade package and the first plugin to obtain an upgraded first plugin includes:
replacing the information to be updated of the second data file of the first plug-in at the position corresponding to the difference information to obtain a third data file;
and obtaining the upgraded first plug-in according to the third data file.
As described above, the method, where the verification information includes legal verification information and first matching verification information, where the legal verification information includes first verification information and second verification information, and the verifying the upgrade package according to the verification information to obtain a result that the verification passes, includes:
encrypting the delta file by adopting an MD5 encryption algorithm to obtain first summary information;
judging whether the first abstract information is the same as the first verification information, if so, decrypting the second verification information through public key decryption to obtain second abstract information, and if so, determining that the upgrade package is legal;
encrypting the second data file by using an MD5 encryption algorithm to obtain third summary information;
and judging whether the third abstract information is the same as the first matching verification information or not, and if so, obtaining a result that the upgrade package passes verification.
The method as described above, the verification information further comprising: the second matching verification information further includes, before obtaining the upgraded first plug-in according to the third data file:
encrypting the third data file by using an MD5 encryption algorithm to obtain fourth summary information;
and judging whether the fourth abstract information is the same as the second matching verification information, if so, determining that the third data file is matched with the upgrade package.
The method for acquiring the upgrade package corresponding to the first plug-in unit comprises the following steps:
sending a query request to a server, wherein the query request comprises an identifier and version information of the first plug-in, and the query request is used for indicating whether an upgrade package corresponding to the first plug-in is stored in the server query;
accordingly, obtaining an upgrade package corresponding to the first plug-in includes:
and acquiring the upgrade package sent by the server when the server determines that the upgrade package corresponding to the first plug-in is stored in the server.
In a second aspect, the present invention provides a plug-in upgrade method, including:
acquiring a differential file, wherein the differential file comprises difference information of a first plugin and a second plugin and a position of the difference information in a first data file of the second plugin, and the second plugin is a latest version plugin corresponding to the first plugin;
acquiring verification information; the verification information is used for verifying the validity of the upgrade package and whether the upgrade package is matched with the first plug-in the process of upgrading the plug-in;
and sending the differential file and the verification information to a server so that the server generates an upgrade package of the first plug-in according to the differential file and the verification information, wherein the upgrade package is used for upgrading the first plug-in.
The method as described above, where the verification information includes legal verification information and first matching verification information, and the obtaining verification information includes:
encrypting the delta file by adopting an MD5 encryption algorithm to obtain first verification information;
encrypting the first verification information through private key encryption to obtain second verification information;
and encrypting the second data file of the first plug-in by using an MD5 encryption algorithm to obtain first matching verification information.
The method as described above, the verification information further comprising: second matching verification information, the obtaining verification information further comprising:
and encrypting the first data file of the second plug-in by adopting an MD5 encryption algorithm to obtain the second matching verification information.
In a third aspect, the present invention provides a plug-in upgrade apparatus, including:
the upgrade package acquisition module is used for acquiring an upgrade package corresponding to the first plug-in; the upgrade package comprises a delta file and verification information, the delta file comprising difference information for the first and second plug-ins and a location of the difference information in a first data file of the second plug-in; the second plug-in is the latest version plug-in corresponding to the first plug-in;
the verification module is used for verifying the upgrade package according to the verification information to obtain a result of passing verification;
and the upgrading module is used for upgrading according to the upgrading packet and the first plug-in unit to obtain the upgraded first plug-in unit.
In a fourth aspect, the present invention provides a plug-in upgrade apparatus, including:
a first obtaining module, configured to obtain a delta file, where the delta file includes difference information of a first plug-in and a second plug-in, and a location of the difference information in a first data file of the second plug-in, and the second plug-in is a latest version plug-in corresponding to the first plug-in;
the second acquisition module is used for acquiring verification information; the verification information is used for verifying the validity of the upgrade package and whether the upgrade package is matched with the first plug-in the process of upgrading the plug-in;
the sending module sends the differential file and the verification information to a server so that the server generates an upgrade package of the first plug-in according to the differential file and the verification information, wherein the upgrade package is used for upgrading the first plug-in.
The invention provides a plug-in upgrading method and a device, wherein the plug-in upgrading method comprises the following steps: acquiring an upgrade package corresponding to a first plug-in; the upgrade package comprises a delta file and verification information, the delta file comprises difference information of the first plug-in and the second plug-in, and a position of the difference information in a first data file of the second plug-in; the second plug-in is the latest version plug-in corresponding to the first plug-in; verifying the upgrade package according to the verification information to obtain a verification passing result; and upgrading according to the upgrading packet and the first plug-in to obtain the upgraded first plug-in. The plug-in upgrading method and device have the advantages of high plug-in upgrading speed and no consumption of user flow.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a diagram of an application scenario of the present invention;
FIG. 2 is a first flowchart of a plug-in upgrade method provided by the present invention;
FIG. 3 is a first diagram illustrating a delta file according to the present invention;
FIG. 4 is a second schematic diagram of a delta file according to the present invention;
FIG. 5 is a third schematic diagram of a delta file according to the present invention;
FIG. 6 is a second flowchart of a plug-in upgrade method provided by the present invention;
FIG. 7 is a third flowchart of the plug-in upgrade method provided by the present invention;
fig. 8 is a schematic structural diagram of a first embodiment of a plug-in upgrading apparatus provided in the present invention;
fig. 9 is a schematic structural diagram of a second embodiment of the plug-in upgrading apparatus provided in the present invention;
fig. 10 is a schematic structural diagram of a third embodiment of the plug-in upgrading device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a diagram of a possible system architecture provided by the present invention. Referring to fig. 1, the system architecture diagram provided in the present embodiment includes a server 11 and a first user equipment 12 and a second user equipment 13. The first user device 12 and the second user device 13 may be, for example, a mobile phone, a tablet, a computer, or the like. The server 11 is used for storing the plug-in and the upgrade package corresponding to the plug-in.
The second user device 13 has at least one application installed therein, which includes at least one plug-in, which may be, for example, a skin plug-in a dog input program.
The first user equipment 12 may obtain a plug-in from the server and generate an upgrade package from the plug-in, where the upgrade package may upgrade the plug-in. The first user equipment 12 sends the generated upgrade package to the server, and the upgrade package is stored by the server and called when the plug-in the second user equipment 13 is upgraded. In order to solve the problems of low upgrade speed of the plug-in and user traffic consumption, the upgrade package generated by the first user equipment 12 only includes the delta file and the verification information, and therefore, the upgrade package acquired by the second user equipment from the server only includes the delta file and the verification information.
The following describes the plug-in upgrading method and device of the present invention in detail. First, the process of making the upgrade package for the first user equipment is described in detail through the embodiment shown in fig. 2. The execution body in fig. 2 described below may be, for example, the first user equipment 12 in fig. 1 described above.
Fig. 2 is a first flowchart of a plug-in upgrading method provided by the present invention, as shown in fig. 2, and is applied to a terminal device, where the method of this embodiment may include:
step S101, obtaining a differential file, wherein the differential file comprises difference information of a first plug-in and a second plug-in and a position of the difference information in a first data file of the second plug-in, and the second plug-in is a latest version plug-in corresponding to the first plug-in;
step S102, obtaining verification information, wherein the verification information is used for verifying the validity of an upgrade patch and whether the upgrade patch is matched with a first plug-in the process of upgrading the plug-in;
step S103, sending the difference file and the verification information to a server so that the server generates an upgrade package of the first plug-in according to the difference file and the verification information, wherein the upgrade package is used for upgrading the first plug-in.
Specifically, the first plugin in this embodiment is a plugin backed up in the server, not a plugin installed in the user equipment, and the second plugin is a latest version plugin corresponding to the first plugin, that is, the second plugin is a plugin obtained by modifying a program code of a first data file (also referred to as a first DEX file) of the first plugin in order to increase a function of the first plugin and/or repair a BUG of the first plugin. And after the second plug-in is obtained, uploading the second plug-in to the server and storing the second plug-in the server.
When generating the upgrade package in this embodiment, first, a first plug-in and a second plug-in are acquired from a server. And after the first plug-in and the second plug-in are obtained, decompressing the first plug-in to obtain a second data file of the first plug-in, and decompressing the second plug-in to obtain a first data file of the second plug-in. The data file refers to a DEX file in the plug-in package, and in the android system, is an Andorid Dalvik executive program file.
Comparing the first data file with the second data file by adopting a BSDIFF difference tool to obtain a difference file, wherein the difference file comprises difference information of the first plug-in and the second plug-in and the position of the difference information in the first data file of the second plug-in; the differences that exist between the first data file and the second data file may be as follows: (1) the first data file contains data A, and the second data file does not contain data A, namely, the data A is newly added in the second plug-in; (2) the first data file does not contain the data B, and the second data file contains the data B, namely the data B is deleted in the second plug-in; (3) the first data file contains data C, and the second data file also contains data C, but the data C in the first data file is different from the data C in the second data file, that is, the second plug-in modifies the data C. The data a and the data C are always difference data, and for the data B, since the operation on the data B is deletion, that is, the data B is data that has no effect, the data B may be ignored and not be present in the difference file, or the operation information of the data B deleted may be recorded in the difference file.
Fig. 3 is a schematic diagram of a delta file according to the first embodiment of the present invention, and referring to fig. 3, in the delta file, a position a corresponds to information of newly added data a, a position C corresponds to information of modified data C, a position B corresponds to operation information of deleted data B, and the positions a, B, and C are all positions in the first data file.
Fig. 4 is a second schematic diagram of the delta file provided by the present invention, referring to fig. 4, in the delta file, a position a corresponds to information of newly added data a, a position C corresponds to information of modified data C, and both positions a and b are positions in the first data file.
Fig. 5 is a third schematic diagram of the delta file provided by the present invention, referring to fig. 5, where a position a corresponds to information of newly added data a, a position C corresponds to information of modified data C, a position b is null data, and positions a, b, and C are all positions in the first data file.
After the difference file is obtained, then verification information is obtained, and the verification information is used for verifying whether the upgrade package is tampered or whether the upgrade package is matched with a first plug-in installed in the user equipment when the plug-in is updated by a terminal user, and the specific process is as follows: the verification information comprises legal verification information, first matching information and second matching information, and the legal verification information comprises the first verification information and the second verification information; encrypting the difference file by adopting an MD5 encryption algorithm to obtain first verification information; encrypting the first verification information through private key encryption to obtain second verification information; encrypting the second data file of the first plug-in by adopting an MD5 encryption algorithm to obtain first matching verification information; and encrypting the first data file of the second plug-in by adopting an MD5 encryption algorithm to obtain second matching verification information.
The security of the upgrade package is ensured by acquiring the verification information, and the phenomenon of upgrade error caused by the fact that the upgrade package does not correspond to the first plug-in to be upgraded is avoided.
After the difference file and the verification information are obtained, the difference file and the verification information are sent to a server, so that the server generates an upgrade package of the first plug-in according to the difference file and the verification information, and the upgrade package is used for upgrading the first plug-in. The server compresses the difference file and each verification information to obtain an upgrade package of the first plug-in, and the upgrade package is used for upgrading the first plug-in the user equipment.
The upgrade package of the first plug-in adopts the version information of the first plug-in to carry on the mark, so as to can download the correct upgrade package when the user equipment carries on the first plug-in upgrade.
The generated upgrade package in the embodiment only includes the differential file and the verification information, the upgrade package occupies a small storage space, the user has a fast download speed, the used flow is small, and in the upgrade process, only the differential file and the second data file need to be compared, so that the upgrade speed is fast.
The plug-in upgrading method of the embodiment comprises the following steps: acquiring a differential file, wherein the differential file comprises difference information of a first plug-in and a second plug-in and a position of the difference information in a first data file of the second plug-in, and the second plug-in is a latest version plug-in corresponding to the first plug-in; acquiring verification information; and sending the differential file and the verification information to a server so that the server generates an upgrade package of the first plug-in according to the differential file and the verification information, wherein the upgrade package is used for upgrading the first plug-in. The plug-in upgrading method of the embodiment has the advantages of high plug-in upgrading speed and no consumption of user traffic.
After the upgrade package is obtained by the method, the upgrade package is used when the user equipment upgrades the first plug-in.
Next, a detailed description is given below of a plug-in upgrade method for a user equipment by using a specific embodiment. As can be understood by those skilled in the art, the upgrade package is the generated upgrade package; the execution subject of the following embodiment may be the second user equipment 13 shown in fig. 1.
Fig. 6 is a second flowchart of the plug-in upgrading method provided by the present invention. As shown in fig. 6, the method of this embodiment may include:
s601, obtaining an upgrade patch corresponding to a first plug-in; the upgrade package comprises a delta file and verification information, the delta file comprising difference information of the first plug-in and the second plug-in, and a location of the difference information in a first data file of the second plug-in; the second plug-in is the latest version plug-in corresponding to the first plug-in;
step S602, verifying the upgrade package according to the verification information to obtain a result of passing the verification;
and step S603, upgrading according to the upgrading packet and the first plug-in to obtain the upgraded first plug-in.
Specifically, the first plug-in the present embodiment is a first plug-in installed in the user equipment.
On the user equipment side, after a main program corresponding to a first plug-in is started, the user equipment sends a query request to a server, wherein the query request comprises an identifier and version information of the first plug-in, and the query request is used for indicating the server to query whether an upgrade package corresponding to the first plug-in is stored or not; and after receiving the query request, the server queries according to the identification and the version information of the first plug-in, if the server queries that the upgrade package corresponding to the first plug-in is stored, the upgrade package corresponding to the first plug-in is sent to the user equipment, and the user equipment receives the upgrade package corresponding to the first plug-in sent by the server and performs the subsequent upgrade process. And when inquiring whether the upgrading packet corresponding to the first plug-in is stored or not, the server inquires whether the upgrading packet with the same identifier as the version information of the first plug-in exists or not.
The upgrade package sent by the server and received by the user equipment comprises: a delta file and verification information, the delta file including difference information for the first plug-in and the second plug-in, and a location of the difference information in the first data file of the second plug-in; and the second plug-in is the latest version plug-in corresponding to the first plug-in.
However, in the process of downloading the upgrade package, the upgrade package may be tampered, so after the upgrade package is obtained, the upgrade package needs to be verified, and the verification mainly includes: verifying whether the upgrade package is legal and whether the upgrade package is matched with the first plug-in; and if the verification result is that the first plug-in unit passes the verification result, upgrading according to the upgrading package and the first plug-in unit to obtain the upgraded first plug-in unit. According to different information contained in the differential file, the specific method of upgrading according to the upgrade package and the first plug-in to obtain the upgraded first plug-in is different. If the delta file is in the form shown in fig. 4 or fig. 5, the specific method for upgrading according to the upgrade package and the first plug-in to obtain the upgraded first plug-in includes: and replacing the information to be updated at the position corresponding to the second data file of the first plug-in with the difference information to obtain a third data file, and obtaining the upgraded first plug-in according to the third data file.
More specifically, if the delta file is in the form shown in fig. 4, the process of obtaining the third data file is as follows: finding the position a in the second data file, adding data A information to the position a, finding the position C in the second data file, and replacing the information at the position C with modified data C information to obtain a third data file; finding the b position in the second data file, replacing the information at the b position with null information, namely deleting the information at the b position, and if the differential file is in the form shown in fig. 5, acquiring a third data file by the following steps: and finding the position a in the second data file, adding data A information at the position a, finding the position C in the second data file, and replacing the information at the position C with modified data C information to obtain a third data file. The second data file in this embodiment is obtained when the user equipment verifies the upgrade package, and specifically includes: and the user equipment acquires the first plug-in, decompresses the first plug-in and obtains a second data file.
In addition, if the delta file is in the form shown in fig. 3, the process of obtaining the third data file: and searching the position a in the second data file, adding data A information to the position a, searching the position C in the second data file, replacing the information at the position C with modified data C information, searching the position b in the second data file, and deleting the original information at the position b in the first plugin according to the deletion operation information corresponding to the position b of the differential file to obtain a third data file.
The verification information included in the upgrade package further includes: correspondingly, before the upgraded first plug-in is obtained according to the third data file, the second matching verification information further includes the following steps:
encrypting the third data file by using an MD5 encryption algorithm to obtain fourth summary information; and judging whether the fourth abstract information is the same as the second matching verification information, if so, determining that the third data file is matched with the upgrade package.
And after the third data file is determined to be matched with the upgrade package, replacing the second data file in the obtained first plug-in before upgrading with the third data file to obtain the upgraded first plug-in.
After the first upgraded plugin is obtained, the user equipment judges whether a main program corresponding to the first plugin is running, if so, the first upgraded plugin is adopted to cover the first plugin before upgrading when the main program corresponding to the first plugin is started next time, and if not, the first upgraded plugin is directly covered on the first plugin before upgrading, namely, the original first plugin of the user equipment is deleted.
The upgrade package obtained in the embodiment only comprises the differential file and the verification information, the upgrade package occupies a small storage space, the user downloads the upgrade package quickly, the used flow is small, and in the upgrade process, the differential file and the second data file are only compared, so that the upgrade speed is high.
The plug-in upgrading method of the embodiment comprises the following steps: acquiring an upgrade package corresponding to a first plug-in; the upgrade package comprises a delta file and verification information, the delta file comprises difference information of the first plug-in and the second plug-in, and a position of the difference information in a first data file of the second plug-in; the second plug-in is the latest version plug-in corresponding to the first plug-in; verifying the upgrade package according to the verification information to obtain a verification passing result; and upgrading according to the upgrading packet and the first plug-in to obtain the upgraded first plug-in. The plug-in upgrading method of the embodiment has the advantages of high plug-in upgrading speed and no consumption of user traffic.
Fig. 7 is a flowchart of a third method for upgrading a plug-in, where as shown in fig. 7, the method in this embodiment is a process of verifying an upgrade package in the previous embodiment, and the method in this embodiment includes:
s701, encrypting the delta file by adopting an MD5 encryption algorithm to obtain first summary information;
step S702, judging whether the first abstract information is the same as the first verification information, if so, decrypting the second verification information through public key decryption to obtain second abstract information, and if the first abstract information is the same as the second abstract information, determining that the upgrade package is legal;
s703, encrypting the second data file by adopting an MD5 encryption algorithm to obtain third summary information;
step S704, determining whether the third summary information is the same as the first matching verification information, and if so, obtaining a result that the verification is passed.
Specifically, the delta file in this embodiment is a delta file included in the downloaded upgrade package, and the delta file is encrypted by using an MD5 encryption algorithm to obtain the first digest information. Since the first verification information is information obtained by encrypting the delta file obtained in the process of generating the upgrade package (the method embodiment shown in fig. 1) by using MD5, if the upgrade package is not tampered, the first digest information should be the same as the first verification information. And if the first summary information is the same as the first verification information, decrypting the second verification information through public key decryption to obtain second summary information. Since the second verification information is obtained by encrypting the private key of the first verification information in the process of generating the upgrade package (in the method embodiment shown in fig. 1), if the upgrade package is not tampered, the first digest information and the second digest information are the same, so that the upgrade package is determined to be legal.
After the upgrade package is determined to be legal, verifying whether the first plug-in acquired by the user equipment is matched with the upgrade package, wherein the specific process comprises the following steps: encrypting the second data file by using an MD5 encryption algorithm to obtain third summary information; whether the third digest information is identical to the first matching verification information is determined, because the first matching verification information is obtained by MD5 encryption of the second data file of the first plug-in (the first plug-in backed up in the server) in the process of generating the upgrade package (the method embodiment shown in fig. 1), and if the upgrade package is not tampered, the first matching verification information should be identical to the third digest information. And after the first matching verification information is determined to be the same as the third abstract information, the first plug-in is matched with the upgrade package, and a result that the upgrade package passes verification is obtained.
The plug-in unit of the embodiment, through the verification of the upgrade package, ensures that the upgrade package is the upgrade package corresponding to the first plug-in unit to be upgraded, and avoids the occurrence of upgrade error caused by the fact that the upgrade package does not correspond to the first plug-in unit to be upgraded.
Fig. 8 is a schematic structural diagram of a first embodiment of a plug-in upgrading apparatus provided in the present invention, and as shown in fig. 8, the apparatus of this embodiment may include: the upgrading system comprises an upgrading packet obtaining module 81, a verification module 82 and an upgrading module 83, wherein the upgrading packet obtaining module 81 is used for obtaining an upgrading packet corresponding to a first plug-in; the upgrade package comprises a delta file and verification information, the delta file comprising difference information of the first plug-in and the second plug-in, and a location of the difference information in a first data file of the second plug-in; the second plug-in is the latest version plug-in corresponding to the first plug-in; the verification module 82 is used for verifying the upgrade package according to the verification information to obtain a result of passing the verification; the upgrade module 83 is configured to upgrade according to the upgrade package and the first plug-in, so as to obtain the upgraded first plug-in.
The verification information comprises first verification information, first matching verification information and second matching information; the upgrading module is specifically used for replacing information to be updated at a position corresponding to a second data file of the first plug-in unit with the difference information to obtain a third data file; encrypting the third data file by using an MD5 encryption algorithm to obtain fourth summary information; judging whether the fourth abstract information is the same as the second matching verification information or not, and if so, determining that the third data file is matched with the upgrade package; and obtaining the upgraded first plug-in according to the third data file.
The verification module 82 is specifically configured to encrypt the delta file by using an MD5 encryption algorithm to obtain first digest information; judging whether the first abstract information is the same as the first verification information, if so, decrypting the second verification information through public key decryption to obtain second abstract information, and if the first abstract information is the same as the second abstract information, determining that the upgrade package is legal; encrypting the second data file by using an MD5 encryption algorithm to obtain third summary information; and judging whether the third abstract information is the same as the first matching verification information or not, and if so, obtaining a result that the upgrade package passes the verification.
The apparatus of this embodiment may be configured to implement the technical solutions of the above method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
Fig. 9 is a schematic structural diagram of a second embodiment of the plug-in upgrading apparatus provided by the present invention, as shown in fig. 9, the apparatus in this embodiment may further include a sending module 84 on the basis of the apparatus structure shown in fig. 8, where the sending module 84 is configured to send an inquiry request to the server, where the inquiry request includes an identifier and version information of the first plug-in, and the inquiry request is used to indicate whether the server inquires whether an upgrade package corresponding to the first plug-in is stored; the upgrade package obtaining module 81 is specifically configured to obtain an upgrade package sent by a server when it is determined that the upgrade package corresponding to the first plug-in is stored in the server.
Fig. 10 is a schematic structural diagram of a third embodiment of the plug-in upgrading apparatus provided in the present invention, as shown in fig. 10, the plug-in upgrading apparatus of the present embodiment includes a first obtaining module 91, a second obtaining module 92, and a sending module 93, where the first obtaining module 91 is configured to obtain a difference file, the difference file includes difference information of a first plug-in and a second plug-in, and a position of the difference information in a first data file of the second plug-in, and the second plug-in is a latest version plug-in corresponding to the first plug-in; the second obtaining module 92 is configured to obtain the verification information; the sending module 93 is configured to send the difference file and the verification information to the server, so that the server generates an upgrade package of the first plug-in according to the difference file and the verification information, where the upgrade package is used for upgrading the first plug-in.
The verification information comprises first verification information, first matching verification information and second matching verification information; the second obtaining module 92 is specifically configured to encrypt the delta file by using an MD5 encryption algorithm to obtain first verification information; encrypting the first verification information through private key encryption to obtain second verification information; encrypting the second data file of the first plug-in by adopting an MD5 encryption algorithm to obtain first matching verification information; and encrypting the first data file of the second plug-in by adopting an MD5 encryption algorithm to obtain second matching verification information.
The apparatus of this embodiment may be configured to implement the technical solutions of the above method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (8)

1. A plug-in upgrading method is applied to terminal equipment, wherein a first plug-in is installed in the terminal equipment, and the method comprises the following steps:
acquiring an upgrade package corresponding to the first plug-in; the upgrade package comprises a delta file and verification information, the delta file comprising difference information for the first and second plug-ins and a location of the difference information in a first data file of the second plug-in; the second plug-in is the latest version plug-in corresponding to the first plug-in;
verifying the upgrade package according to the verification information to obtain a verification passing result;
upgrading according to the upgrading packet and the first plug-in to obtain an upgraded first plug-in;
the verifying information comprises legal verifying information and first matching verifying information, the legal verifying information comprises first verifying information and second verifying information, the upgrading packet is verified according to the verifying information to obtain a result of passing verification, and the method comprises the following steps:
encrypting the delta file by adopting an MD5 encryption algorithm to obtain first summary information;
judging whether the first abstract information is the same as the first verification information, if so, decrypting the second verification information through public key decryption to obtain second abstract information, and if so, determining that the upgrade package is legal;
encrypting the second data file of the first plug-in by using an MD5 encryption algorithm to obtain third summary information;
and judging whether the third abstract information is the same as the first matching verification information or not, and if so, obtaining a result that the upgrade package passes verification.
2. The method of claim 1, wherein the upgrading according to the upgrade package and the first plug-in to obtain an upgraded first plug-in, comprises:
replacing the information to be updated at the position corresponding to the second data file of the first plug-in with the difference information to obtain a third data file;
and obtaining the upgraded first plug-in according to the third data file.
3. The method of claim 2, wherein the authentication information further comprises: the second matching verification information further includes, before obtaining the upgraded first plug-in according to the third data file:
encrypting the third data file by using an MD5 encryption algorithm to obtain fourth summary information;
and judging whether the fourth abstract information is the same as the second matching verification information, if so, determining that the third data file is matched with the upgrade package.
4. The method according to any one of claims 1 to 3, wherein the obtaining of the upgrade package corresponding to the first plug-in comprises:
sending a query request to a server, wherein the query request comprises an identifier and version information of the first plug-in, and the query request is used for indicating whether an upgrade package corresponding to the first plug-in is stored in the server query;
accordingly, obtaining an upgrade package corresponding to the first plug-in includes:
and acquiring the upgrade package sent by the server when the server determines that the upgrade package corresponding to the first plug-in is stored in the server.
5. A method for upgrading a plug-in, comprising:
acquiring a differential file, wherein the differential file comprises difference information of a first plugin and a second plugin and a position of the difference information in a first data file of the second plugin, and the second plugin is a latest version plugin corresponding to the first plugin;
acquiring verification information; the verification information is used for verifying the validity of the upgrade package and whether the upgrade package is matched with the first plug-in the process of upgrading the plug-in;
sending the differential file and the verification information to a server so that the server generates an upgrade package of the first plug-in according to the differential file and the verification information, wherein the upgrade package is used for upgrading the first plug-in;
the verification information includes first verification information, second verification information and first matching verification information, and the acquiring verification information includes:
encrypting the delta file by adopting an MD5 encryption algorithm to obtain first verification information;
encrypting the first verification information through private key encryption to obtain second verification information;
and encrypting the second data file of the first plug-in by using an MD5 encryption algorithm to obtain first matching verification information.
6. The method of claim 5, wherein the authentication information further comprises: second matching verification information, the obtaining verification information further comprising:
and encrypting the first data file of the second plug-in by adopting an MD5 encryption algorithm to obtain the second matching verification information.
7. A plug-in upgrade apparatus, comprising:
the upgrading package obtaining module is used for obtaining an upgrading package corresponding to the first plug-in; the upgrade package comprises a delta file and verification information, the delta file comprising difference information for the first and second plug-ins and a location of the difference information in a first data file of the second plug-in; the second plug-in is the latest version plug-in corresponding to the first plug-in;
the verification module is used for verifying the upgrade package according to the verification information to obtain a result of passing verification;
the upgrading module is used for upgrading according to the upgrading packet and the first plug-in unit to obtain an upgraded first plug-in unit;
the verification information comprises legal verification information and first matching verification information, and the legal verification information comprises first verification information and second verification information;
the verification module is specifically configured to encrypt the delta file by using an MD5 encryption algorithm to obtain first digest information, determine whether the first digest information is the same as the first verification information, decrypt the second verification information by using public key decryption if the first digest information is the same as the first verification information to obtain second digest information, determine that the upgrade package is legal if the first digest information is the same as the second digest information, encrypt the second data file of the first plugin by using an MD5 encryption algorithm to obtain third digest information, determine whether the third digest information is the same as the first matching verification information, and obtain a result that the upgrade package passes verification if the third digest information is the same as the first matching verification information.
8. A plug-in upgrade apparatus, comprising:
a first obtaining module, configured to obtain a delta file, where the delta file includes difference information of a first plug-in and a second plug-in, and a location of the difference information in a first data file of the second plug-in, and the second plug-in is a latest version plug-in corresponding to the first plug-in;
the second acquisition module is used for acquiring verification information; the verification information is used for verifying the validity of the upgrade package and whether the upgrade package is matched with the first plug-in the process of upgrading the plug-in;
the sending module is used for sending the differential file and the verification information to a server so that the server generates an upgrade package of the first plug-in unit according to the differential file and the verification information, and the upgrade package is used for upgrading the first plug-in unit;
the verification information comprises first verification information, second verification information and first matching verification information, and the second obtaining module is specifically configured to encrypt the delta file by using an MD5 encryption algorithm to obtain first verification information, encrypt the first verification information by using private key encryption to obtain second verification information, and encrypt the second data file of the first plug-in by using an MD5 encryption algorithm to obtain first matching verification information.
CN201710296360.4A 2017-04-28 2017-04-28 Plug-in upgrading method and device Active CN107239299B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710296360.4A CN107239299B (en) 2017-04-28 2017-04-28 Plug-in upgrading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710296360.4A CN107239299B (en) 2017-04-28 2017-04-28 Plug-in upgrading method and device

Publications (2)

Publication Number Publication Date
CN107239299A CN107239299A (en) 2017-10-10
CN107239299B true CN107239299B (en) 2020-07-17

Family

ID=59984249

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710296360.4A Active CN107239299B (en) 2017-04-28 2017-04-28 Plug-in upgrading method and device

Country Status (1)

Country Link
CN (1) CN107239299B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108829419A (en) * 2018-06-07 2018-11-16 安徽鼎龙网络传媒有限公司 A kind of update of plug-in and self-measuring system in micro- scene management backstage mobile phone store
CN109257228A (en) * 2018-10-25 2019-01-22 网宿科技股份有限公司 A kind of data-updating method and Edge Server
CN111064720B (en) * 2019-12-10 2022-09-16 大唐半导体科技有限公司 Method and device for converting configuration gateway data protocol
CN111142906B (en) * 2019-12-25 2023-11-10 浙江大华技术股份有限公司 Method, device and equipment for iterating equipment firmware upgrading scheme
CN111932243A (en) * 2020-07-15 2020-11-13 中国银联股份有限公司 Riding code plug-in management method, device, server, terminal equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120222025A1 (en) * 2011-02-25 2012-08-30 Red Hat, Inc. Version compatibility determination
CN102707977A (en) * 2012-05-17 2012-10-03 江苏中科梦兰电子科技有限公司 Increment upgrading method based on Android application software
CN103699410A (en) * 2013-12-20 2014-04-02 北京奇虎科技有限公司 Method and device for updating application programs
CN106250148A (en) * 2016-08-01 2016-12-21 浪潮软件集团有限公司 ANT-based project difference upgrading method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120222025A1 (en) * 2011-02-25 2012-08-30 Red Hat, Inc. Version compatibility determination
CN102707977A (en) * 2012-05-17 2012-10-03 江苏中科梦兰电子科技有限公司 Increment upgrading method based on Android application software
CN103699410A (en) * 2013-12-20 2014-04-02 北京奇虎科技有限公司 Method and device for updating application programs
CN106250148A (en) * 2016-08-01 2016-12-21 浪潮软件集团有限公司 ANT-based project difference upgrading method

Also Published As

Publication number Publication date
CN107239299A (en) 2017-10-10

Similar Documents

Publication Publication Date Title
CN107239299B (en) Plug-in upgrading method and device
CN109787774B (en) Upgrade downloading method and device based on digital signature verification, server and terminal
CN107797817B (en) Application updating method and device
CN111263352B (en) OTA upgrading method and system of vehicle-mounted equipment, storage medium and vehicle-mounted equipment
CN111832013A (en) Firmware upgrading method and device
US20150121478A1 (en) Permission Management Method, Apparatus, and Terminal
US20140150096A1 (en) Method for assuring integrity of mobile applications and apparatus using the method
CN109862099B (en) Upgrade checking method, device, terminal and system
CN104346167A (en) Method and device for generating application channel package
US9547757B2 (en) User terminal, server and controlling method thereof
US11947673B2 (en) Over-the-air upgrade method and related apparatus
CN109309725B (en) Application downloading and updating method and device, computer equipment and storage medium
CN112579125B (en) Firmware upgrading method and device, electronic equipment and storage medium
CN107038353B (en) Software program checking protection method and system
CN114880011A (en) OTA (over the air) upgrading method and device, electronic equipment and readable storage medium
CN111399867B (en) Software upgrading method, device, equipment and computer readable storage medium
CN113961226B (en) Software development kit repairing method, terminal, server and equipment
WO2016173174A1 (en) Network locking data upgrading method and device
CN111417927B (en) Resource authority processing method and device, storage medium and chip
CN114143197B (en) OTA (over the air) upgrading method, device and equipment for Internet of things equipment and readable storage medium
CN111046389A (en) Method for securely updating firmware components and portable computer station for implementation
CN114816495A (en) OTA (over the air) upgrading method and device, electronic equipment and readable storage medium
CN114675865A (en) Method and device for upgrading over-the-air technology, storage medium and terminal equipment
US20180113704A1 (en) Method, Head Unit, and Vehicle for Introducing Applications into the Head Unit of the Vehicle
US20220198051A1 (en) Method of protecting data and computer device

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