CN113961206A - Patch package installation method and device, electronic equipment and storage medium - Google Patents

Patch package installation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113961206A
CN113961206A CN202111205643.6A CN202111205643A CN113961206A CN 113961206 A CN113961206 A CN 113961206A CN 202111205643 A CN202111205643 A CN 202111205643A CN 113961206 A CN113961206 A CN 113961206A
Authority
CN
China
Prior art keywords
patch package
record file
patch
latest
package
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.)
Pending
Application number
CN202111205643.6A
Other languages
Chinese (zh)
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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202111205643.6A priority Critical patent/CN113961206A/en
Publication of CN113961206A publication Critical patent/CN113961206A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

The embodiment of the application discloses a method and a device for installing a patch package, electronic equipment and a storage medium; the method comprises the following steps: acquiring a latest patch package of an application program; for each patch package other than the latest patch package stored locally: comparing the difference record file and the deletion record file corresponding to the patch package and a preset patch package, wherein the preset patch package is all patch packages with installation time later than that of the patch package; if all resources included by the patch package are completely covered by the difference record file and the deletion record file corresponding to the preset patch package, deleting the patch package; and loading the latest patch package into the application program to complete the installation of the latest patch package. In the application, the updating can be downloaded in a patch package mode, useless old patch packages can be deleted in a mode of comparing the patch packages with the difference record files and the deletion record files, and therefore the storage space occupied by the patch packages is reduced, and the time consumed by downloading is reduced.

Description

Patch package installation method and device, electronic equipment and storage medium
Technical Field
The application relates to the field of computers, in particular to a patch package installation method and device, electronic equipment and a storage medium.
Background
In the prior art, when patching an application program, a server usually obtains a difference between a new version of the application program and a version installed in a terminal, and then packages the content of the difference into a Patch package (referred to as Patch package). When a user holding the terminal runs the application program, an application program client installed in the terminal inquires whether a new patch package needs to be downloaded or not from the server, and the server returns information of the existence of the patch package and a download address of the patch package, so that the application program client downloads the patch package according to the download address and applies the patch package to the application program to realize updating. However, the above-mentioned method will make the storage space occupied by the application program larger and larger.
It is also known in the art that the server obtains the difference between the new version of the application and the version installed in the terminal and obtains a plurality of files constituting the difference. When a user having a terminal runs an application, an application client inquires a server whether an update file exists. The server returns the download addresses of the files, the application program client downloads the files one by one, the installed patch packages are split, the files are newly added or replaced for the patch packages, and then the patch packages are reassembled into new patch packages. However, the download speed of small files is slow.
Disclosure of Invention
The embodiment of the application provides a patch package installation method, a patch package installation device, electronic equipment and a storage medium, and can solve the problems that the prior art either occupies larger and larger storage space or takes longer time for downloading.
The embodiment of the application provides a method for installing a patch package, which comprises the following steps: acquiring a latest patch package of an application program, wherein the latest patch package comprises a difference record file and a deletion record file, and the difference record file is used for recording newly added resources and modified resources of the latest patch package compared with a previous patch package; the deletion record file is used for recording the deleted resources of the latest patch package compared with the previous patch package; for each locally stored patch package other than the most recent patch package: comparing the difference record file and the deletion record file corresponding to the patch package and a preset patch package, wherein the preset patch package is all patch packages with installation time later than that of the patch package; if all the resources included in the patch package are completely covered by the difference record file and the deletion record file corresponding to the preset patch package, deleting the patch package; and loading the latest patch package into the application program to complete the installation of the latest patch package.
The embodiment of the present application further provides a method for installing a patch package, where the method includes: acquiring newly added resources and modified resources compared with the previous version of the application program in the latest version of the application program, and packaging the newly added resources and the modified resources into a primarily selected patch package; acquiring resource information corresponding to the newly added resource and the modified resource, and recording the resource information in a difference record file; acquiring resource information corresponding to the deleted resource compared with the previous version of the application program in the latest version of the application program, and recording the resource information in a deletion record file; and sending the difference record file, the deleted record file and the initially selected patch package to a terminal together, wherein the difference record file, the deleted record file and the initially selected patch package are recorded as a latest patch package.
An embodiment of the present application further provides a patch package installation apparatus, including:
the system comprises a latest patch package obtaining unit, a latest patch package obtaining unit and a latest service management unit, wherein the latest patch package comprises a difference record file and a deletion record file, and the difference record file is used for recording the newly added resources and the modified resources of the latest patch package compared with the previous patch package; the deletion record file is used for recording the deleted resources of the latest patch package compared with the previous patch package;
a comparing unit, configured to, for each locally stored patch package except the latest patch package: comparing the difference record file and the deletion record file corresponding to the patch package and a preset patch package, wherein the preset patch package is all patch packages with installation time later than that of the patch package;
a patch package deleting unit, configured to delete the patch package if all resources included in the patch package are completely covered by the difference record file and the deletion record file corresponding to the preset patch package;
and the latest patch package installation unit is used for loading the latest patch package into the application program so as to complete the installation of the latest patch package.
In some embodiments, the comparison process between the difference record file and the deletion record file corresponding to each patch package and the preset patch package is sequentially performed according to the installation time sequence of the patch packages.
In some embodiments, the apparatus further comprises:
and the patch package retaining unit is used for retaining the patch package when all resources included by the patch package are not completely covered by the difference record file and the deletion record file corresponding to the preset patch package.
In some embodiments, the installation time sequence of the patch packages is recorded in a patch package installation record file corresponding to the application program.
In some embodiments, the apparatus further comprises:
and the record information deleting unit is used for deleting the record information corresponding to the deleted patch package in the patch package installation record file.
An embodiment of the present application further provides a patch package installation apparatus, including:
the initial selection packing unit is used for acquiring newly added resources and modified resources compared with the previous version of the application program in the latest version of the application program, and packing the newly added resources and the modified resources into an initial selection patch package;
the difference file unit is used for acquiring the resource information corresponding to the newly added resource and the modified resource and recording the resource information in a difference record file;
a file deletion unit, configured to acquire resource information corresponding to a resource deleted by comparing the latest version of the application program with the previous version of the application program, and record the resource information in a deletion record file;
and the latest patch package generation unit is used for sending the difference record file, the deletion record file and the initially selected patch package to a terminal together, wherein the difference record file, the deletion record file and the initially selected patch package are marked as the latest patch package.
In some embodiments, the deleting the file unit includes:
a current information obtaining subunit, configured to obtain current resource information corresponding to the latest version, where the current resource information includes information of all resources of the latest version;
a history information obtaining subunit, configured to obtain history resource information corresponding to the previous version, where the history resource information includes information of all resources of the previous version;
and the deletion information comparison subunit is used for comparing the current resource information with the historical resource information to acquire the resource information corresponding to the deleted resource compared with the previous version in the latest version.
The embodiment of the application also provides electronic equipment, which comprises a memory, a storage and a control unit, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps of any patch package installation method provided by the embodiment of the application.
The embodiments of the present application further provide a computer-readable storage medium, where a plurality of instructions are stored, where the instructions are suitable for being loaded by a processor to perform any one of the steps in the patch package installation method provided in the embodiments of the present application.
In the patch package installation method provided by the embodiment of the application, the latest patch package of the application program can be obtained, and then for each locally stored patch package except the latest patch package, the difference record file and the deletion record file of the patch package and all patch packages with installation time later than that of the patch package are compared; if the content in the patch package is completely covered by the difference record file and the deletion record file, it indicates that the content contained in the patch package is either modified or deleted, so that the patch package can be deleted. After the comparison operation is performed on each patch package except the latest patch package, the latest patch package can be loaded into the application program, so that the installation of the latest patch package is completed.
In the application, the updating can be downloaded in a patch package mode, useless old patch packages can be deleted in a mode of comparing the patch packages with the difference record files and the deletion record files, and therefore the storage space occupied by the patch packages is reduced, and the time consumed by downloading is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1a is a schematic view of a scenario of a patch package installation method provided in an embodiment of the present application;
fig. 1b is a schematic flowchart of a method for installing a patch package according to an embodiment of the present application;
FIG. 2 is a schematic flowchart of a method for installing a patch package according to another embodiment of the present application;
fig. 3 is a flowchart illustrating a specific implementation of a method for installing a patch package according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a patch package installation apparatus according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a patch package installation apparatus according to another embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. 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 application.
The embodiment of the application provides a patch package installation method and device, electronic equipment and a storage medium.
The patch package installation apparatus may be specifically integrated in an electronic device, and the electronic device may be a terminal, a server, or other devices. The terminal can be a mobile phone, a tablet Computer, an intelligent bluetooth device, a notebook Computer, or a Personal Computer (PC), and the like; the server may be a single server or a server cluster composed of a plurality of servers.
In some embodiments, the patch package installation apparatus may also be integrated into a plurality of electronic devices, for example, the patch package installation apparatus may be integrated into a plurality of servers, and the patch package installation method of the present application is implemented by the plurality of servers.
In some embodiments, the server may also be implemented in the form of a terminal.
For example, referring to fig. 1a, a latest patch package of an application program is obtained, where the latest patch package includes a difference record file and a deletion record file, and the difference record file is used to record the resources newly added and modified by the latest patch package compared with the previous patch package; the deletion record file is used for recording the deleted resources of the latest patch package compared with the previous patch package; for each locally stored patch package other than the most recent patch package: comparing the difference record file and the deletion record file corresponding to the patch package and a preset patch package, wherein the preset patch package is all patch packages with installation time later than that of the patch package; if all the resources included in the patch package are completely covered by the difference record file and the deletion record file corresponding to the preset patch package, deleting the patch package; and loading the latest patch package into the application program to complete the installation of the latest patch package.
For example, please refer to fig. 1a for details, it is not assumed that the patch packages other than the latest patch package stored locally by the terminal include a patch package a and a patch package b, the installation time of the patch package a is earlier than that of the patch package b, and the patch package a, the patch package b and the latest patch package all have respective difference record files and deletion record files, and the difference record files and the deletion record files are included in the corresponding patch packages.
For the patch package a, all patch packages with installation time later than that of the patch package a are: patch b and the latest patch. Therefore, the patch package a can be compared with the patch package b and the union set of the difference record file and the deletion record file corresponding to the latest patch package, that is, whether all the resources included in the patch package a are completely covered by the union set of the difference record file and the deletion record file corresponding to the patch package b and the difference record file and the deletion record file corresponding to the latest patch package b can be judged. If the difference record file is completely covered, the total resources included in the patch package a are either modified (the resources recorded in the difference record file) or deleted (the resources recorded in the deletion record file), so that the patch package a has no influence on the normal operation of the current application program, and the patch package a can be deleted.
For the patch package b, all patch packages with installation time later than that of the patch package b are as follows: and (5) updating the patch package. Therefore, the patch package b can be compared with the union of the difference record file and the deletion record file corresponding to the latest patch package, that is, whether all the resources included in the patch package b are completely covered by the union of the difference record file and the deletion record file corresponding to the latest patch package can be judged. If the difference record file is completely covered, the total resources included in the patch package b are either modified (the resources recorded in the difference record file) or deleted (the resources recorded in the deletion record file), so that the patch package b has no influence on the normal operation of the current application program, and the patch package b can be deleted.
After the comparison processing is performed on the patch package a and the patch package b, the latest patch package can be loaded into the application program, so that the installation of the latest patch package is completed.
The following are detailed below. The numbers in the following examples are not intended to limit the order of preference of the examples.
In this embodiment, a patch package installation method is provided, as shown in fig. 1b, where the patch package installation method is applied to a terminal, and a specific flow of the method may include the following steps 101 to 104:
101. and obtaining the latest patch package of the application program.
The application program is software which can realize version updating along with the downloading and installation of the patch package, the application program can be social software, game software and the like, and the specific software type of the application program is not to be understood as the limitation of the application program.
The patch package may be a package that solves the above-described problem and is issued in response to the problem that the application is exposed during use, or may be a package that updates the function or content of the application. The latest patch package is the patch package which is released by the developer and is the latest time from the current time.
The latest patch package comprises a difference record file and a deletion record file, and the difference record file is used for recording the newly added resources and the modified resources compared with the previous patch package; the deletion record file is used for recording the deleted resources of the latest patch package compared with the previous patch package, wherein the previous patch package of the latest patch package is the patch package with the installation time being only earlier than that of the latest patch package.
102. For each locally stored patch package other than the most recent patch package: and comparing the difference record file and the deletion record file corresponding to the patch package and the preset patch package.
The preset patch package is all patch packages with installation time later than that of the patch package. It should be understood that each patch package has its own corresponding preset patch package due to different installation times, that is, the number of the preset patch packages corresponding to each patch package is different.
As described further in the foregoing example, referring to fig. 1a, since the installation time of the patch package a is earlier than that of the patch package b, after the terminal receives the latest patch package, the preset patch packages corresponding to the patch package a are all the patch packages later than the patch package a: patch package b and the latest patch package; the preset patch package corresponding to the patch package b is all patch packages later than the patch package b: and (5) updating the patch package.
In order to avoid that the patch packages with the installation time earlier than that of the deleted patch package cannot be compared completely, the comparison process of the difference record file and the deletion record file corresponding to each patch package and the preset patch package can be sequentially executed according to the installation time sequence of the patch packages, namely, the patch package with the early installation time is firstly executed with the preset patch package corresponding to the patch package, and the comparison process with the preset patch package corresponding to the patch package is executed after the patch package with the late installation time, for example, the comparison process of the preset patch package corresponding to the patch package a is executed for the patch package a, and then the comparison process of the preset patch package corresponding to the patch package b is executed for the patch package b.
The installation time sequence of the patch packages is recorded in a patch package installation record file corresponding to the application program.
The terminal may further store a patch package installation record file corresponding to the application program, and in the patch package installation record file, information of a plurality of patch packages of the application program may be recorded in the order of installation time from morning to evening. In the patch package installation record file, the information of each patch package and the installation time corresponding to each patch package may also be recorded, and the information of each patch package is regularly sorted according to the installation time. Alternatively, the patch package installation record file may be named PatchList.
103. And if all the resources included by the patch package are completely covered by the difference record file and the deletion record file corresponding to the preset patch package, deleting the patch package.
The resource is information used for supporting the application program to run in the patch package, for example, if the application program is social software, the resource may be program code or interface information for realizing a new function of the social software, or the like; if the application is game software, the resource may be a tile, audio, script, or the like in the game.
If the patch package is completely covered, the total resources included in the patch package are either modified (the resources recorded in the difference record file) or deleted (the resources recorded in the deletion record file), so that the patch package has no influence on the normal operation of the current application program, and the patch package can be deleted. The patch package comprises a corresponding difference record file and a corresponding deletion record file, so that the difference record file and the deletion record file corresponding to the patch package can be deleted along with the deletion of the patch package.
Optionally, in a specific implementation manner, after step 102, the embodiment of the present application may further include: and if all the resources included by the patch package are not completely covered by the difference record file and the deletion record file corresponding to the preset patch package, reserving the patch package.
If all the resources included in the patch package are not completely covered by the difference record file and the deletion record file corresponding to the preset patch package, it indicates that at least one resource in the patch package is not modified or deleted, so that if the patch package is missing, the operation of the current application program is affected, and the patch package can be reserved.
Optionally, in a specific embodiment, after step 103, the following steps may be further included: and deleting the corresponding record information of the deleted patch package in the patch package installation record file.
After the patch package is deleted, the record information of the deleted patch package in the patch package installation record file can be deleted, so that the storage space corresponding to the patch package installation record file is saved.
104. And loading the latest patch package into the application program to complete the installation of the latest patch package.
After the operations in steps 102 to 103 are performed on each locally stored patch package except the latest patch package, the result of deletion or retention of each patch package is determined, and then the latest patch package can be loaded into the application program to complete installation of the latest patch package, thereby completing version update of the application program.
By the method provided by the embodiment of the application, the latest patch package of the application program can be obtained, and then for each locally stored patch package except the latest patch package, the difference record file and the deletion record file of the patch package and all patch packages with installation time later than that of the patch package are compared; if the content in the patch package is completely covered by the difference record file and the deletion record file, it indicates that the content contained in the patch package is either modified or deleted, so that the patch package can be deleted; if the content in the patch package is not completely covered by the difference record file and the deletion record file, it indicates that the content included in the patch package has at least one content that is not modified or deleted, and therefore the patch package can be reserved. After the comparison operation is performed on each patch package except the latest patch package, the latest patch package can be loaded into the application program, so that the installation of the latest patch package is completed.
According to the method and the device, the patch package can be downloaded and updated in a patch package mode, useless old patch packages can be deleted in a mode of comparing the patch package with the difference record file and the deletion record file, and therefore the storage space occupied by the patch package is reduced, and the time consumed by downloading is reduced.
In this embodiment, a patch package installation method is provided, as shown in fig. 2, where the patch package installation method is applied to a server, and a specific flow of the method may be as follows:
201. and acquiring newly added resources and modified resources compared with the previous version of the application program in the latest version of the application program, and packaging the newly added resources and the modified resources into a primarily selected patch package.
The latest version of the application program is the version that is acquired by the developer through development work and is closest to the time of the current moment. The previous version of the application refers to a version that is released only earlier in time than the latest version of the application, and is typically a version that has already been installed in the user's terminal.
By comparing the latest version with the previous version of the application program, newly added resources and modified resources of the application program can be obtained, and the newly added resources and the modified resources can be packaged into an initially selected patch package, so that after a complete patch package is obtained through subsequent processing, the patch package is sent to each terminal by a server to complete version updating of the application program in the terminal.
202. And acquiring the resource information corresponding to the newly added resource and the modified resource, and recording the resource information in a difference record file.
Except for packing the newly added resource and the modified resource into the initially selected patch package, the method can also obtain the resource information corresponding to the newly added resource and the modified resource respectively, and record the resource information in the difference record file.
For example, taking the application program as game software as an example, it is not assumed that:
the previous version of game software included: audio a, audio b, audio c, map a, map b, map c, script a, script b, script c and script d;
the latest version of game software includes: audio a, audio b, audio d, audio e, map a, map b, map c, script a, script b, script c, and map c is modified compared to the previous version.
For the game software, the newly added resources are: audio d, audio e; the resources modified are then: therefore, the resource information corresponding to the audio d, the resource information corresponding to the audio e, and the resource information corresponding to the map c can be recorded in the difference recording file.
Optionally, the difference record file may be named as a PatchFileList version number txt, where a specific path of the difference record file on the server is Key, a Message-Digest algorithm 5 (MD 5) code corresponding to the difference record file is Value, and the version number is the version number of the latest version.
203. And acquiring resource information corresponding to the deleted resource compared with the previous version of the application program in the latest version of the application program, and recording the resource information in a deletion record file.
Optionally, in a specific embodiment, the step 203 specifically includes the following steps S1 to S3:
and S1, acquiring the current resource information corresponding to the latest version.
Wherein the current resource information includes information of all resources of the latest version.
And S2, acquiring historical resource information corresponding to the previous version.
Wherein the historical resource information includes information of all resources of the previous version.
S3, comparing the current resource information with the historical resource information, and acquiring the resource information corresponding to the deleted resource compared with the previous version in the latest version.
The description continues with the example above where the application is game software:
compared with the previous version, the deleted resources of the latest version of the game software are as follows: therefore, the resource information corresponding to the audio c and the resource information corresponding to the script d can be recorded in the difference recording file.
Alternatively, the delete record file may be named DeleteFileList version number txt, where the version number is the version number of the latest version.
204. And sending the difference record file, the deleted record file and the primarily selected patch package to a terminal together.
And recording the difference record file, the deleted record file and the initially selected patch package as a latest patch package.
In the foregoing embodiment, by comparing the resources of the latest version and the previous version of the application program, the newly added resources, the modified resources, and the deleted resources compared to the latest version and the previous version of the application program are obtained, the newly added resources and the modified resources are packaged into the initially selected patch package, the newly added resources and the modified resources are recorded in the difference record file, and the deleted resources are recorded in the deletion record file. And then the difference record file, the deleted record file and the initially selected patch package are jointly recorded as a latest patch package, so that the latest patch package is sent to the terminal. In the embodiment, the resources which are not utilized any more along with the change of the application program version are better counted by acquiring the resources deleted by the new version and the old version, and the old patch package installed in the terminal is deleted according to the part of the resources which are not utilized any more, so that the storage space in the terminal can be saved.
The method described in the above embodiments is further described in detail below.
In this embodiment, the method of the embodiment of the present application will be described in detail by taking an example in which the application program is game software.
As shown in fig. 3, a specific flow of the patch package installation method is as follows:
301. the server obtains newly-added resources and modified resources compared with the latest version and the previous version of the game software, and packs the newly-added resources and the modified resources into an initially-selected patch package.
302. And the server acquires the resource information corresponding to the newly added resource and the modified resource and records the resource information in the difference record file.
303. And the server acquires the resource information corresponding to the deleted resource compared with the previous version of the latest version of the game software and records the resource information in the deletion record file.
304. And the server records the difference record file, the deleted record file and the initially selected patch package as a latest patch package together and sends the latest patch package to the terminal.
305. The terminal obtains the latest patch package of the game software.
306. The terminal stores, for each patch package other than the latest patch package, the following: and comparing the difference record file and the deletion record file corresponding to the patch package and the preset patch package.
307. And if all the resources included by the patch package are completely covered by the difference record file and the deletion record file corresponding to the preset patch package, the terminal deletes the patch package.
308. And if all the resources included by the patch package are not completely covered by the difference record file and the deletion record file corresponding to the preset patch package, the terminal reserves the patch package.
309. And the terminal loads the latest patch package into the application program to complete the installation of the latest patch package.
Therefore, by the method provided by the embodiment of the application, the updating can be downloaded in a patch package mode, and useless old patch packages can be deleted in a mode of comparing the patch packages with the difference record file and the deletion record file, so that the storage space occupied by the patch packages is reduced, and the time consumed by downloading is reduced.
In order to better implement the method, an embodiment of the present application further provides a patch package installation apparatus, where the patch package installation apparatus may be specifically integrated in an electronic device, and the electronic device may be a terminal. The terminal can be a mobile phone, a tablet computer, an intelligent Bluetooth device, a notebook computer, a personal computer and other devices.
For example, in the present embodiment, the method in the embodiment of the present application will be described in detail by taking an example in which the patch package installation apparatus is specifically integrated in the terminal.
For example, as shown in fig. 4, the patch package installation apparatus may include:
a latest patch package obtaining unit 401, configured to obtain a latest patch package of an application, where the latest patch package includes a difference record file and a deletion record file, and the difference record file is used to record resources that are newly added and modified compared with a previous patch package; the deletion record file is used for recording the deleted resources of the latest patch package compared with the previous patch package;
a comparing unit 402, configured to, for each locally stored patch package except the latest patch package: comparing the difference record file and the deletion record file corresponding to the patch package and a preset patch package, wherein the preset patch package is all patch packages with installation time later than that of the patch package;
a patch package deleting unit 403, configured to delete the patch package if all resources included in the patch package are completely covered by the difference record file and the deletion record file corresponding to the preset patch package;
a latest patch package installation unit 404, configured to load the latest patch package into the application program to complete installation of the latest patch package.
In some embodiments, the comparison process between the difference record file and the deletion record file corresponding to each patch package and the preset patch package is sequentially performed according to the installation time sequence of the patch packages.
In some embodiments, the apparatus further comprises:
and the patch package retaining unit is used for retaining the patch package when all resources included by the patch package are not completely covered by the difference record file and the deletion record file corresponding to the preset patch package.
In some embodiments, the installation time sequence of the patch packages is recorded in a patch package installation record file corresponding to the application program.
In some embodiments, the apparatus further comprises:
and the record information deleting unit is used for deleting the record information corresponding to the deleted patch package in the patch package installation record file.
In a specific implementation, the above units may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and the specific implementation of the above units may refer to the foregoing method embodiments, which are not described herein again.
As can be seen from the above, in this embodiment, after the comparison operation is performed on each patch package except the latest patch package, the completely covered patch package is deleted, the patch packages which are not completely covered are retained, and then the latest patch package can be loaded into the application program, so that the installation of the latest patch package is completed.
Therefore, the method and the device for downloading the patch package can download and update the new version of the application program in the patch package mode, and can delete useless old patch packages in the mode of comparing the patch package with the difference record file and the deletion record file, so that the storage space occupied by the patch package is reduced, and the time consumed for downloading is reduced.
In order to better implement the method, an embodiment of the present application further provides a patch package installation apparatus, where the patch package installation apparatus may be specifically integrated in an electronic device, and the electronic device may be a server. The server may be a single server, or a server cluster composed of a plurality of servers.
For example, in the present embodiment, the method of the present embodiment will be described in detail by taking an example in which the patch package installation apparatus is specifically integrated in the server.
For example, as shown in fig. 5, the patch package installation apparatus may include:
a primary selection packing unit 501, configured to obtain a newly added resource and a modified resource compared with a previous version of the application program in a latest version of the application program, and pack the newly added resource and the modified resource into a primary selection patch package;
a difference file unit 502, configured to obtain resource information corresponding to the newly added resource and the modified resource, and record the resource information in a difference record file;
a delete file unit 503, configured to acquire resource information corresponding to the resource deleted by comparing the latest version of the application with the previous version of the application, and record the resource information in a delete record file;
a latest patch package generating unit 504, configured to send the difference record file, the deleted record file, and the initially selected patch package to a terminal together, where the difference record file, the deleted record file, and the initially selected patch package are marked as a latest patch package.
In some embodiments, the delete file unit 503 includes:
a current information obtaining subunit, configured to obtain current resource information corresponding to the latest version, where the current resource information includes information of all resources of the latest version;
a history information obtaining subunit, configured to obtain history resource information corresponding to the previous version, where the history resource information includes information of all resources of the previous version;
and the deletion information comparison subunit is used for comparing the current resource information with the historical resource information to acquire the resource information corresponding to the deleted resource compared with the previous version in the latest version.
In a specific implementation, the above units may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and the specific implementation of the above units may refer to the foregoing method embodiments, which are not described herein again.
As can be seen from the above, in the embodiment, by acquiring the resources deleted by the new version and the old version, the resources that are no longer utilized along with the change of the application version are better counted, and according to the part of the resources that are no longer utilized, the deletion of the old patch package installed in the terminal is realized, so that the storage space in the terminal can be saved.
The embodiment of the application also provides the electronic equipment which can be equipment such as a terminal and a server. The terminal can be a mobile phone, a tablet computer, an intelligent Bluetooth device, a notebook computer, a personal computer and the like; the server may be a single server, a server cluster composed of a plurality of servers, or the like.
In some embodiments, the patch package installation apparatus may also be integrated into a plurality of electronic devices, for example, the patch package installation apparatus may be integrated into a plurality of servers, and the patch package installation method of the present application is implemented by the plurality of servers.
In this embodiment, the electronic device of this embodiment is described in detail as an example, for example, as shown in fig. 6, it shows a schematic structural diagram of the electronic device according to the embodiment of the present application, specifically:
the electronic device may include components such as a processor 601 of one or more processing cores, memory 602 of one or more computer-readable storage media, a power supply 603, an input module 604, and a communication module 605. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 6 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the processor 601 is a control center of the electronic device, connects various parts of the whole electronic device by using various interfaces and lines, and performs various functions of the electronic device and processes data by operating or executing software programs and/or modules stored in the memory 602 and calling data stored in the memory 602, thereby performing overall monitoring of the electronic device. In some embodiments, processor 601 may include one or more processing cores; in some embodiments, processor 601 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 601.
The memory 602 may be used to store software programs and modules, and the processor 601 executes various functional applications and data processing by operating the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory 602 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.
The electronic device also includes a power supply 603 for providing power to the various components, and in some embodiments, the power supply 603 may be logically coupled to the processor 601 through a power management system, such that functions of managing charging, discharging, and power consumption are performed through the power management system. The power supply 603 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
The electronic device may also include an input module 604, where the input module 604 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
The electronic device may also include a communication module 605, and in some embodiments the communication module 605 may include a wireless module, through which the electronic device may wirelessly transmit over short distances, thereby providing wireless broadband internet access to the user. For example, the communication module 605 may be used to assist a user in emailing, browsing web pages, accessing streaming media, and the like.
Although not shown, the electronic device may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 601 in the electronic device loads the executable file corresponding to the process of one or more application programs into the memory 602 according to the following instructions, and the processor 601 runs the application program stored in the memory 602, thereby implementing various functions as follows:
acquiring a latest patch package of an application program, wherein the latest patch package comprises a difference record file and a deletion record file, and the difference record file is used for recording newly added resources and modified resources of the latest patch package compared with a previous patch package; the deletion record file is used for recording the deleted resources of the latest patch package compared with the previous patch package; for each locally stored patch package other than the most recent patch package: comparing the difference record file and the deletion record file corresponding to the patch package and a preset patch package, wherein the preset patch package is all patch packages with installation time later than that of the patch package; if all the resources included in the patch package are completely covered by the difference record file and the deletion record file corresponding to the preset patch package, deleting the patch package; and loading the latest patch package into the application program to complete the installation of the latest patch package.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a computer-readable storage medium, in which a plurality of instructions are stored, where the instructions can be loaded by a processor to execute the steps in any one of the patch package installation methods provided in the embodiments of the present application. For example, the instructions may perform the steps of:
acquiring a latest patch package of an application program, wherein the latest patch package comprises a difference record file and a deletion record file, and the difference record file is used for recording newly added resources and modified resources of the latest patch package compared with a previous patch package; the deletion record file is used for recording the deleted resources of the latest patch package compared with the previous patch package; for each locally stored patch package other than the most recent patch package: comparing the difference record file and the deletion record file corresponding to the patch package and a preset patch package, wherein the preset patch package is all patch packages with installation time later than that of the patch package; if all the resources included in the patch package are completely covered by the difference record file and the deletion record file corresponding to the preset patch package, deleting the patch package; and loading the latest patch package into the application program to complete the installation of the latest patch package.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
According to an aspect of the application, a computer program product or computer program is provided, comprising computer instructions, the computer instructions being stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method provided in the various alternative implementations provided in the embodiments described above.
Since the instructions stored in the storage medium may execute the steps in any of the patch package installation methods provided in the embodiments of the present application, beneficial effects that can be achieved by any of the patch package installation methods provided in the embodiments of the present application may be achieved, which are detailed in the foregoing embodiments and will not be described herein again.
The method, the apparatus, the electronic device, and the computer-readable storage medium for installing the patch package provided by the embodiments of the present application are described in detail above, and a specific example is applied in the description to explain the principles and embodiments of the present application, and the description of the embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (11)

1. A method for installing a patch package, the method comprising:
acquiring a latest patch package of an application program, wherein the latest patch package comprises a difference record file and a deletion record file, and the difference record file is used for recording newly added resources and modified resources of the latest patch package compared with a previous patch package; the deletion record file is used for recording the deleted resources of the latest patch package compared with the previous patch package;
for each locally stored patch package other than the most recent patch package:
comparing the difference record file and the deletion record file corresponding to the patch package and a preset patch package, wherein the preset patch package is all patch packages with installation time later than that of the patch package;
if all the resources included in the patch package are completely covered by the difference record file and the deletion record file corresponding to the preset patch package, deleting the patch package;
and loading the latest patch package into the application program to complete the installation of the latest patch package.
2. The method as claimed in claim 1, wherein the comparison process between the difference record file and the deletion record file corresponding to each patch package and the preset patch package is performed sequentially according to the installation time sequence of the patch packages.
3. The method according to claim 1 or 2, wherein after the comparing the difference record file and the deletion record file corresponding to the patch package and the preset patch package, the method further comprises:
and if all the resources included by the patch package are not completely covered by the difference record file and the deletion record file corresponding to the preset patch package, reserving the patch package.
4. The method as claimed in claim 2, wherein the installation time sequence of the patch packages is recorded in a patch package installation record file corresponding to the application program.
5. The method of claim 4, wherein after deleting the patch package, the method further comprises:
and deleting the corresponding record information of the deleted patch package in the patch package installation record file.
6. A method for installing a patch package, the method comprising:
acquiring newly added resources and modified resources compared with the previous version of the application program in the latest version of the application program, and packaging the newly added resources and the modified resources into a primarily selected patch package;
acquiring resource information corresponding to the newly added resource and the modified resource, and recording the resource information in a difference record file;
acquiring resource information corresponding to the deleted resource compared with the previous version of the application program in the latest version of the application program, and recording the resource information in a deletion record file;
and sending the difference record file, the deleted record file and the initially selected patch package to a terminal together, wherein the difference record file, the deleted record file and the initially selected patch package are recorded as a latest patch package.
7. The method of claim 6, wherein the obtaining resource information corresponding to the deleted resource of the latest version of the application compared to the previous version of the application comprises:
acquiring current resource information corresponding to the latest version, wherein the current resource information comprises information of all resources of the latest version;
acquiring historical resource information corresponding to the previous version, wherein the historical resource information comprises information of all resources of the previous version;
and comparing the current resource information with the historical resource information to obtain the resource information corresponding to the deleted resource compared with the previous version in the latest version.
8. A patch package installation apparatus, the apparatus comprising:
the system comprises a latest patch package obtaining unit, a latest patch package obtaining unit and a latest service management unit, wherein the latest patch package comprises a difference record file and a deletion record file, and the difference record file is used for recording the newly added resources and the modified resources of the latest patch package compared with the previous patch package; the deletion record file is used for recording the deleted resources of the latest patch package compared with the previous patch package;
a comparing unit, configured to, for each locally stored patch package except the latest patch package: comparing the difference record file and the deletion record file corresponding to the patch package and a preset patch package, wherein the preset patch package is all patch packages with installation time later than that of the patch package;
a patch package deleting unit, configured to delete the patch package if all resources included in the patch package are completely covered by the difference record file and the deletion record file corresponding to the preset patch package;
and the latest patch package installation unit is used for loading the latest patch package into the application program so as to complete the installation of the latest patch package.
9. A patch package installation apparatus, the apparatus comprising:
the initial selection packing unit is used for acquiring newly added resources and modified resources compared with the previous version of the application program in the latest version of the application program, and packing the newly added resources and the modified resources into an initial selection patch package;
the difference file unit is used for acquiring the resource information corresponding to the newly added resource and the modified resource and recording the resource information in a difference record file;
a file deletion unit, configured to acquire resource information corresponding to a resource deleted by comparing the latest version of the application program with the previous version of the application program, and record the resource information in a deletion record file;
and the latest patch package generation unit is used for sending the difference record file, the deletion record file and the initially selected patch package to a terminal together, wherein the difference record file, the deletion record file and the initially selected patch package are marked as the latest patch package.
10. An electronic device comprising a processor and a memory, the memory storing a plurality of instructions; the processor loads instructions from the memory to perform the steps of the patch package installation method according to any one of claims 1 to 7.
11. A computer readable storage medium storing instructions adapted to be loaded by a processor to perform the steps of the patch package installation method of any one of claims 1 to 7.
CN202111205643.6A 2021-10-15 2021-10-15 Patch package installation method and device, electronic equipment and storage medium Pending CN113961206A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111205643.6A CN113961206A (en) 2021-10-15 2021-10-15 Patch package installation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111205643.6A CN113961206A (en) 2021-10-15 2021-10-15 Patch package installation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113961206A true CN113961206A (en) 2022-01-21

Family

ID=79464701

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111205643.6A Pending CN113961206A (en) 2021-10-15 2021-10-15 Patch package installation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113961206A (en)

Similar Documents

Publication Publication Date Title
CN107832100B (en) APK plug-in loading method and terminal thereof
CN104182255A (en) Method and terminal for upgrading library files of system application
CN111026414B (en) HDP platform deployment method based on kubernetes
KR20110128846A (en) Programming model for synchronizing browser caches across devices and web services
CN109614167B (en) Method and system for managing plug-ins
CN108614976A (en) Authority configuring method, device and storage medium
CN112114849B (en) Resource updating method and device
CN106886422A (en) Method for upgrading software and device, electronic equipment
CN104038520A (en) Multi-version distributed resource management method and multi-version distributed resource management system
CN108563440A (en) The automatic adding method of List Controller code, device and readable storage medium storing program for executing
CN104731622A (en) Application program loading method and device and mobile terminal
CN113254156A (en) Container group deployment method and device, electronic equipment and storage medium
CN115344284A (en) Automatic driving software upgrading method and device, storage medium and computer equipment
CN104573496A (en) Method and device for inhibiting starting items from starting
CN112988062A (en) Metadata reading limiting method and device, electronic equipment and medium
CN113961206A (en) Patch package installation method and device, electronic equipment and storage medium
CN115714706A (en) Access acceleration system and method based on embedded H5, storage medium and electronic equipment
CN107667343B (en) System and method for loading on-demand resources
CN114860203A (en) Project creation method, project creation device, server and storage medium
CN115964061A (en) Plug-in updating method and device, electronic equipment and computer readable storage medium
CN114756261A (en) Container cluster upgrading method and system, electronic equipment and medium
CN108733805B (en) File interaction method, system, computer equipment and storage medium
CN110007937B (en) System updating method and system
CN111984299A (en) Data loading method and equipment
CN109918153B (en) Page opening method and device and page content retrieval method and 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