Patch package installation method and device, electronic equipment and storage medium
By comparing the differences between the latest patch package and the patch packages stored locally, and by deleting deletion records, useless patch packages are deleted and the latest patch packages are loaded, thus solving the problems of storage space consumption and slow download speed, and achieving efficient patch package management.
Patent Information
- Application Number
- CN202111205643.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-15
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2041-10-15
AI Technical Summary
In existing technologies, the methods of installing application patch packages lead to problems such as increasing storage space usage or slow download speeds.
By obtaining the difference log file and deletion log file from the latest patch package, the differences and deletion status of the locally stored patch package are compared with the preset patch package. Patch packages that have been completely overwritten are deleted, and the latest patch package is loaded.
This reduces the storage space occupied by patch packages, shortens download time, and achieves efficient patch package management.
Smart Images

Figure CN113961206B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the computer field, in particular to a patch package installation method and device, electronic equipment and storage medium. BACKGROUND
[0002] In the prior art, when patching an application program, a server usually obtains the difference between a new version of the application program and a version installed in a terminal, and then packs the difference into a patch package (referred to as Patch package). When a user holding the terminal runs the application program, the application program client installed in the terminal inquires the server whether there is a new patch package to be downloaded, and the server returns information that the patch package exists 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 it to the application program, thereby realizing updating. However, the above method will make the storage space occupied by the application program larger and larger.
[0003] In the prior art, there is another method that the server obtains the difference between a new version of the application program and a version installed in a terminal, and obtains a plurality of files constituting the difference. When a user holding the terminal runs the application program, the application program client inquires the server whether there is an update file. The server returns a plurality of download addresses of the files, and the application program client downloads the plurality of files one by one, splits the installed patch package, adds or replaces files in the patch package, and then reassembles a new patch package. However, the download speed of small files is slow. SUMMARY
[0004] Embodiments of the present application provide a patch package installation method, device, electronic equipment and storage medium, which can improve the problems of the prior art that the storage space is occupied more and more or the download time is longer.
[0005] Embodiments of the present application provide a patch package installation method, which comprises: obtaining a latest patch package of an application program, wherein the latest patch package comprises a difference record file and a deletion record file, the difference record file is used to record resources added and resources modified in the latest patch package compared with a previous patch package, and the deletion record file is used to record resources deleted in the latest patch package compared with the previous patch package; for each patch package stored locally except the latest patch package: comparing the patch package with difference record files and deletion record files corresponding to preset patch packages, wherein the preset patch packages are all patch packages with installation time later than the patch package; if all resources included in the patch package are completely covered by the difference record files and the deletion record files corresponding to the preset patch packages, deleting the patch package; loading the latest patch package into the application program to complete installation of the latest patch package.
[0006] The embodiment of the present application further provides a patch package installation method, which comprises the following steps: obtaining resources added and modified in a latest version of an application program compared with a previous version of the application program, and packing the added and modified resources into a preliminary selected patch package; obtaining resource information corresponding to the added and modified resources, and recording the resource information in a difference record file; obtaining resource information corresponding to deleted resources in the latest version of the application program compared with the previous version of the application program, and recording the resource information in a deletion record file; and sending the difference record file, the deletion record file and the preliminary selected patch package to a terminal together, wherein the difference record file, the deletion record file and the preliminary selected patch package are recorded as a latest patch package.
[0007] The embodiment of the present application further provides a patch package installation device, which comprises:
[0008] a latest patch package obtaining unit, configured to obtain a latest patch package of an application program, wherein the latest patch package comprises a difference record file and a deletion record file, the difference record file is used to record added and modified resources in the latest patch package compared with a previous patch package, and the deletion record file is used to record deleted resources in the latest patch package compared with the previous patch package;
[0009] a comparison unit, configured to compare, for each patch package stored locally and except the latest patch package, difference record files and deletion record files corresponding to the patch package and preset patch packages, wherein the preset patch packages are all patch packages with installation time later than the patch package;
[0010] 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 files and the deletion record files corresponding to the preset patch packages;
[0011] a latest patch package installing unit, configured to load the latest patch package into the application program to complete installation of the latest patch package.
[0012] In some embodiments, the comparison process of the difference record files and the deletion record files corresponding to each patch package and the preset patch packages is sequentially performed according to installation time of the patch packages.
[0013] In some embodiments, the device further comprises:
[0014] a patch package retaining unit, configured to retain the patch package when all resources included in the patch package are not completely covered by the difference record files and the deletion record files corresponding to the preset patch packages.
[0015] In some embodiments, the installation time sequence of the patch package is recorded in the patch package installation record file corresponding to the application.
[0016] In some embodiments, the apparatus further comprises:
[0017] A record information deletion unit configured to delete the record information corresponding to the deleted patch package in the patch package installation record file.
[0018] Embodiments of the present application also provide a patch package installation apparatus, which comprises:
[0019] A preliminary selection packaging unit configured to acquire the added and modified resources of the latest version of an application compared with a previous version of the application, and package the added and modified resources into a preliminary selection patch package;
[0020] A difference file unit configured to acquire resource information corresponding to the added and modified resources, and record the resource information in a difference record file;
[0021] A deletion file unit configured to acquire resource information corresponding to the deleted resources of the latest version of the application compared with the previous version of the application, and record the resource information in a deletion record file;
[0022] A latest patch package generation unit configured to send the difference record file, the deletion record file and the preliminary selection patch package to a terminal together, wherein the difference record file, the deletion record file and the preliminary selection patch package are recorded as a latest patch package.
[0023] In some embodiments, the deletion file unit comprises:
[0024] A current information acquisition subunit configured to acquire current resource information corresponding to the latest version, wherein the current resource information comprises information of all resources of the latest version;
[0025] A history information acquisition subunit configured to acquire history resource information corresponding to the previous version, wherein the history resource information comprises information of all resources of the previous version;
[0026] A deletion information comparison subunit configured to compare the current resource information with the history resource information, and acquire resource information corresponding to the deleted resources of the latest version compared with the previous version.
[0027] Embodiments of the present application also provide an electronic device comprising a memory storing a plurality of instructions, and a processor loading the instructions from the memory to execute steps in any patch package installation method provided by embodiments of the present application.
[0028] The embodiment of the present application further provides a computer readable storage medium, which stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute steps in any patch package installation method provided by the embodiment of the present application.
[0029] In the patch package installation method provided by the embodiment of the present application, the latest patch package of an application program can be acquired, and then for each patch package stored locally except the latest patch package, the difference record file and the deletion record file of the patch package and all patch packages installed later than 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 is indicated that the content contained in the patch package is modified or deleted, and therefore 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, and therefore the installation of the latest patch package is completed.
[0030] In the present application, the update can be downloaded by means of the patch package, and the useless old patch package can be deleted by means of comparison between the patch package and the difference record file and the deletion record file, so that the storage space occupied by the patch package is reduced and the time consumption of downloading is reduced. BRIEF DESCRIPTION OF DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort on the basis of these drawings.
[0032] Figure 1a FIG. 1 is a scenario diagram of the patch package installation method provided by the embodiment of the present application;
[0033] Figure 1b FIG. 2 is a flow diagram of the patch package installation method provided by an embodiment of the present application;
[0034] Figure 2 FIG. 3 is a flow diagram of the patch package installation method provided by another embodiment of the present application;
[0035] Figure 3 FIG. 4 is a flow diagram of a specific implementation of the patch package installation method provided by the embodiment of the present application;
[0036] Figure 4 FIG. 5 is a structural diagram of the patch package installation device provided by an embodiment of the present application;
[0037] Figure 5 FIG. 6 is a structural diagram of the patch package installation device provided by another embodiment of the present application;
[0038] Figure 6 FIG. 1 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0039] 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. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person skilled in the art without creative work fall within the protection scope of the present application.
[0040] The present application provides a patch package installation method and device, an electronic device and a storage medium.
[0041] The patch package installation device can be integrated in an electronic device, which can be a terminal, a server or the like. The terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a notebook computer or a personal computer (PC) or the like. The server can be a single server or a server cluster composed of multiple servers.
[0042] In some embodiments, the patch package installation device can also be integrated in multiple electronic devices, for example, the patch package installation device can be integrated in multiple servers, and the multiple servers can be used to implement the patch package installation method of the present application.
[0043] In some embodiments, the server can also be implemented in the form of a terminal.
[0044] For example, referring to Figure 1a , a latest patch package of an application program is acquired, wherein the latest patch package includes a difference record file and a deletion record file. The difference record file is used to record resources newly added and resources modified in the latest patch package compared with a previous patch package. The deletion record file is used to record resources deleted in the latest patch package compared with the previous patch package. For each patch package stored locally except the latest patch package: the difference record file and the deletion record file corresponding to a preset patch package are compared with the patch package, wherein the preset patch package is all patch packages with installation time later than 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, the patch package is deleted. The latest patch package is loaded into the application program to complete installation of the latest patch package.
[0045] For example, refer to Figure 1aLet's assume that the terminal's local storage contains patch packages other than the latest patch package, namely patch package a and patch package b. Patch package a was installed earlier than patch package b, and patch package a, patch package b, and the latest patch package each have their own difference log files and deletion log files, which are included in their respective patch packages.
[0046] For patch package a, all patch packages installed later than patch package a are: patch package b and the latest patch package. Therefore, we can compare the union of the difference log files and deletion log files corresponding to patch package a, patch package b, and the latest patch package to determine if all resources included in patch package a are completely overwritten by the union of the difference log files and deletion log files corresponding to patch package b and the latest patch package. If they are completely overwritten, it means that all resources included in patch package a have either been modified (resources recorded in the difference log file) or deleted (resources recorded in the deletion log file). Therefore, patch package a has no impact on the normal operation of the current application and can be deleted.
[0047] For patch package b, all patch packages installed later than patch package b are considered the latest patch packages. Therefore, we can compare the union of the difference log file and deletion log file corresponding to patch package b with the latest patch package to determine whether all resources included in patch package b are completely covered by the union of the difference log file and deletion log file corresponding to the latest patch package. If they are completely covered, it means that all resources included in patch package b have either been modified (resources recorded in the difference log file) or deleted (resources recorded in the deletion log file). Therefore, patch package b has no impact on the normal operation of the current application and can be deleted.
[0048] After performing the above comparison process on patch package a and patch package b respectively, the latest patch package can be loaded into the application, thereby completing the installation of the latest patch package.
[0049] The following sections provide detailed descriptions of each example. It should be noted that the sequence numbers of the following embodiments are not intended to limit the preferred order of the embodiments.
[0050] In this embodiment, a patch installation method is provided, such as... Figure 1b As shown, this patch installation method is applied to the terminal, and the specific process of this method can be summarized in steps 101 to 104 as follows:
[0051] 101. Obtain the latest patch package for the application.
[0052] The application program is software that can be updated in version with the installation of a patch package. The application program can be social software, game software, etc. The specific software type of the application program should not be understood as a limitation on the present application.
[0053] The patch package can be a program package that solves the problems exposed in the use of the application program, or a program package that updates the function or content of the application program. The latest patch package is the patch package closest to the current time that is published by the developer.
[0054] The latest patch package includes a difference record file and a deletion record file. The difference record file is used to record the resources added and the resources modified in the latest patch package compared with the previous patch package. The deletion record file is used to record the resources deleted in the latest patch package compared with the previous patch package. The previous patch package of the latest patch package is the patch package whose installation time is only earlier than that of the latest patch package.
[0055] 102. For each patch package stored locally except the latest patch package: compare the patch package with the difference record file and the deletion record file corresponding to the preset patch package.
[0056] The preset patch package is all patch packages whose installation time is later than that of the patch package. It should be understood that each patch package has its own corresponding preset patch package due to the difference in installation time, that is, the number of preset patch packages corresponding to each patch package is different.
[0057] The above example continues to illustrate, please see Figure 1a Since the installation time of patch package a is earlier than that of patch package b, after the terminal receives the latest patch package, the preset patch package corresponding to patch package a is all patch packages later than patch package a: patch package b and the latest patch package. The preset patch package corresponding to patch package b is all patch packages later than patch package b: the latest patch package.
[0058] In order to avoid that the patch package whose installation time is earlier than the deleted patch package cannot be compared comprehensively, 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 executed in order according to the installation time of the patch package, that is, the patch package with earlier installation time is executed first, and the patch package with later installation time is executed later, for example, patch package a is executed first, and patch package b is executed later.
[0059] The installation time sequence of the patch package is recorded in the patch package installation record file corresponding to the application program.
[0060] The terminal can also store a patch package installation record file corresponding to the application program. In the patch package installation record file, information of a plurality of patch packages of the application program can be recorded in order of installation time from early to late. In the patch package installation record file, information of each patch package and installation time corresponding to each patch package can also be recorded, and information of each patch package can be sorted periodically according to installation time. Alternatively, the patch package installation record file can be named PatchList.
[0061] 103. 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, the patch package is deleted.
[0062] The resources are information in the patch package for supporting running of the application program. For example, if the application program is social software, the resources can be program code or interface information for implementing new functions of the social software, etc. If the application program is game software, the resources can be a map, audio or script in the game, etc.
[0063] If the patch package is completely covered, it means that all resources included in the patch package are either modified (resources recorded in the difference record file) or deleted (resources recorded in the deletion record file), and therefore, the patch package has no influence on normal running of the current application program, and the patch package can be deleted. The patch package includes the corresponding difference record file and deletion record file, and therefore, the difference record file and the deletion record file corresponding to the patch package are deleted together with the patch package.
[0064] Alternatively, in a specific embodiment, after step 102, the embodiment of the application can further include: if all 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, the patch package is retained.
[0065] If all 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 means that at least one resource in the patch package is not modified or deleted, and therefore, if the patch package is missing, it will have an influence on running of the current application program, and the patch package can be retained.
[0066] Alternatively, in a specific embodiment, after step 103, the following step can be further included: deleting, in the patch package installation record file, record information corresponding to the deleted patch package.
[0067] After the patch package is deleted, record information of the deleted patch package in the patch package installation record file can also be deleted, thereby saving storage space corresponding to the patch package installation record file.
[0068] 104. Load the latest patch package into the application to complete the installation of the latest patch package.
[0069] After performing steps 102 to 103 on each patch package in local storage except for the latest patch package, the result of deleting or retaining each patch package is determined. Then, the latest patch package can be loaded into the application to complete the installation of the latest patch package, thereby completing the application version update.
[0070] The method provided in this application embodiment can obtain the latest patch package for the application. Then, for each patch package stored locally (excluding the latest patch package), the difference record file and deletion record file are compared with all patch packages installed later than the current patch package. If the content of the patch package is completely overwritten by the difference record file and deletion record file, it indicates that the content contained in the patch package has either been modified or deleted, and therefore the patch package can be deleted. If the content of the patch package is not completely overwritten by the difference record file and deletion record file, it indicates that at least one piece of content contained in the patch package has not been modified or deleted, and therefore the patch package can be retained. After performing the above comparison operation on each patch package except the latest patch package, the latest patch package can be loaded into the application, thereby completing the installation of the latest patch package.
[0071] This application embodiment can download updates via patch packages, and can also delete useless old patch packages by comparing patch packages with difference record files and deletion record files, thereby reducing the storage space occupied by patch packages and reducing download time.
[0072] In this embodiment, a patch installation method is provided, such as... Figure 2 As shown, this patch installation method is applied to the server, and the specific process of this method can be summarized in steps 201 to 204:
[0073] 201. Obtain the resources added and modified in the latest version of the application compared with the previous version of the application, and package the added and modified resources into a preliminary patch package.
[0074] The latest version of an application is the version most recent to the current time, obtained by the developers after their development work. The previous version of an application is the version released just before the latest version; typically, the previous version is the version already installed on the user's device.
[0075] By comparing the latest version of the application program with the previous version, the newly added resources and the modified resources of the application program can be obtained, and the newly added resources and the modified resources can be packaged into a preliminary patch package, so that after subsequent processing to obtain a complete patch package, the server sends the complete patch package to each terminal to complete the version update of the application program in the terminal.
[0076] 202、Obtain the resource information corresponding to the newly added resources and the modified resources, and record in the difference record file.
[0077] In addition to packaging the newly added resources and the modified resources into a preliminary patch package, the resource information corresponding to the newly added resources and the modified resources can also be obtained, and the resource information can be recorded in the difference record file.
[0078] For example, taking the application program as a game software, it is assumed that:
[0079] The previous version of the game software includes: audio a, audio b, audio c, map a, map b, map c, script a, script b, script c, and script d.
[0080] The latest version of the game software includes: audio a, audio b, audio d, audio e, map a, map b, map c, script a, script b, script c, and script d.
[0081] Therefore, for the game software, the newly added resources are audio d and audio e, and the modified resources are map c. Therefore, the difference record file can record the resource information corresponding to audio d, the resource information corresponding to audio e, and the resource information corresponding to map c.
[0082] Optionally, the difference record file can be named PatchFileList version number.txt, the specific path of the difference record file in the server is Key, the information corresponding to the difference record file is a Message-Digest algorithm 5 (MD5) code Value, and the version number is the version number of the latest version.
[0083] 203、Obtain the resource information corresponding to the deleted resources of the latest version of the application program compared with the previous version of the application program, and record in the deletion record file.
[0084] Optionally, in a specific embodiment, step 203 specifically includes steps S1-S3:
[0085] S1, obtain the current resource information corresponding to the latest version.
[0086] The current resource information includes the information of all resources of the latest version.
[0087] S2, obtaining historical resource information corresponding to the previous version.
[0088] The historical resource information includes information of all resources of the previous version.
[0089] S3, comparing the current resource information with the historical resource information, and obtaining resource information corresponding to the deleted resource compared between the latest version and the previous version.
[0090] The above is continued to be described with the example that the application program is game software.
[0091] The deleted resource compared between the latest version and the previous version of the game software is audio c and script d, therefore, the difference record file can record resource information corresponding to audio c and resource information corresponding to script d.
[0092] Optionally, the deletion record file can be named as DeleteFileList version number.txt, wherein the version number is the version number of the latest version.
[0093] 204, sending the difference record file, the deletion record file and the preliminary selected patch package to the terminal.
[0094] The difference record file, the deletion record file and the preliminary selected patch package are recorded as the latest patch package.
[0095] In the above embodiment, the newly added resource, the modified resource and the deleted resource compared between the latest version and the previous version of the application program can be obtained by comparing the resources of the latest version and the previous version of the application program, the newly added resource and the modified resource are packaged into the preliminary selected patch package, the newly added resource and the modified resource are recorded in the difference record file, and the deleted resource is recorded in the deletion record file. Then the difference record file, the deletion record file and the preliminary selected patch package are recorded as the latest patch package, so that the latest patch package is sent to the terminal. The above embodiment better counts the resources no longer used with the change of the version of the application program by obtaining the deleted resource compared between the new and old versions, and realizes the deletion of the old patch package installed in the terminal according to the part of the resources no longer used, so that the storage space in the terminal can be saved.
[0096] The method described in the above embodiment will be further described in detail.
[0097] In this embodiment, the method of the present application will be described in detail with the example that the application program is game software.
[0098] As Figure 3As shown, a patch package installation method specific process as follows:
[0099] 301, the server obtains the newly added resources and modified resources of the latest version of the game software compared with the previous version, and packs the newly added resources and modified resources into a preliminary patch package.
[0100] 302, the server obtains the resource information corresponding to the newly added resources and modified resources, and records it in the difference record file.
[0101] 303, the server obtains the resource information corresponding to the deleted resources of the latest version of the game software compared with the previous version, and records it in the deletion record file.
[0102] 304, the server records the difference record file, deletion record file and preliminary patch package as the latest patch package, and sends the latest patch package to the terminal.
[0103] 305, the terminal obtains the latest patch package of the game software.
[0104] 306, the terminal compares the difference record file and the deletion record file corresponding to the preset patch package for each patch package stored locally except the latest patch package.
[0105] 307, 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, the terminal deletes the patch package.
[0106] 308, 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, the terminal retains the patch package.
[0107] 309, the terminal loads the latest patch package into the application to complete the installation of the latest patch package.
[0108] As can be seen from the above, through the method provided by the application, the useless old patch package can be deleted through the comparison of the patch package and the difference record file and the deletion record file, and the storage space occupied by the patch package is reduced, and the time consumption of downloading is reduced.
[0109] In order to better implement the above method, the application embodiment further provides a patch package installation device, which can be integrated in an electronic device, which can be a terminal. The terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a notebook computer, a personal computer and the like.
[0110] For example, in the embodiment, the patch package installation apparatus is integrated in a terminal, and the method of the embodiment is described in detail.
[0111] For example, as shown in Figure 4 the patch package installation apparatus can include:
[0112] a latest patch package obtaining unit 401 configured to obtain a latest patch package of an application program, wherein the latest patch package includes a difference record file and a deletion record file, the difference record file is used to record resources added and modified in the latest patch package compared with a previous patch package, and the deletion record file is used to record resources deleted in the latest patch package compared with the previous patch package;
[0113] a comparison unit 402 configured to compare, for each patch package stored locally and except the latest patch package, a difference record file and a deletion record file corresponding to a preset patch package, wherein the preset patch package is all patch packages installed later than the patch package;
[0114] 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;
[0115] a latest patch package installing unit 404 configured to load the latest patch package into the application program to complete installation of the latest patch package.
[0116] In some embodiments, the comparison of the difference record file and the deletion record file corresponding to the patch package and the preset patch package is sequentially performed according to installation time of the patch package.
[0117] In some embodiments, the apparatus further includes:
[0118] a patch package retaining unit configured to retain the patch package when all 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.
[0119] In some embodiments, the installation time sequence of the patch package is recorded in a patch package installation record file corresponding to the application program.
[0120] In some embodiments, the apparatus further includes:
[0121] a record information deleting unit configured to delete record information corresponding to the deleted patch package in the patch package installation record file.
[0122] In practice, the above units can be implemented as independent entities, or combined as the same or several entities, and the implementation of the above units can refer to the method embodiments above, which will not be repeated here.
[0123] As can be seen, the present embodiment deletes the completely covered patch package and retains the not completely covered patch package by performing the comparison operation on each patch package except the latest patch package, and then loads the latest patch package into the application program, thereby completing the installation of the latest patch package.
[0124] Therefore, the embodiments of the present application can download the new version of the application program through the patch package, and delete the useless old patch package through the comparison of the patch package, the difference record file and the deletion record file, thereby reducing the storage space occupied by the patch package and the download time.
[0125] In order to better implement the above method, the embodiments of the present application further provide a patch package installation device, which can be integrated in an electronic device, and the electronic device can be a server. The server can be a single server or a server cluster composed of multiple servers.
[0126] For example, in the present embodiment, the patch package installation device is integrated in the server, and the method of the embodiments of the present application is described in detail.
[0127] For example, as shown in Figure 5 The patch package installation device can include:
[0128] The preliminary selection packaging unit 501 is configured to obtain the added resources and modified resources of the latest version of the application program compared with the previous version of the application program, and package the added resources and modified resources into a preliminary selection patch package;
[0129] The difference file unit 502 is configured to obtain the resource information corresponding to the added resources and modified resources, and record in a difference record file;
[0130] The deletion file unit 503 is configured to obtain the resource information corresponding to the deleted resources of the latest version of the application program compared with the previous version of the application program, and record in a deletion record file;
[0131] The latest patch package generation unit 504 is configured to send the difference record file, the deletion record file and the preliminary selection patch package to the terminal together, wherein the difference record file, the deletion record file and the preliminary selection patch package are recorded as a latest patch package.
[0132] In some embodiments, the deletion file unit 503 includes:
[0133] a current information obtaining sub-unit, configured to obtain current resource information corresponding to the latest version, wherein the current resource information comprises information of all resources of the latest version;
[0134] a history information obtaining sub-unit, configured to obtain history resource information corresponding to the previous version, wherein the history resource information comprises information of all resources of the previous version;
[0135] a deletion information comparing sub-unit, configured to compare the current resource information with the history resource information, and obtain resource information corresponding to resources deleted by comparison between the latest version and the previous version.
[0136] In implementation, the above units can be implemented as independent entities, or can be combined as one or several entities, and the implementation of the above units can refer to the method embodiments above, which will not be repeated here.
[0137] As can be seen from the above, the present embodiment can better count the resources no longer used with the change of the application version by obtaining the resources deleted by comparison between the new and old versions, and delete the old patch installed in the terminal according to the resources no longer used, so as to save the storage space in the terminal.
[0138] The present application also provides an electronic device, which can be a terminal, a server, etc. The terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a notebook computer, a personal computer, etc., and the server can be a single server or a server cluster composed of multiple servers, etc.
[0139] In some embodiments, the patch installation apparatus can also be integrated in multiple electronic devices, for example, the patch installation apparatus can be integrated in multiple servers, and the multiple servers can implement the patch installation method of the present application.
[0140] In the present embodiment, the electronic device of the present embodiment will be taken as an example for detailed description, for example, as shown in FIG. 1, which shows a structural schematic diagram of the electronic device of the present embodiment, and specifically: Figure 6
[0141] The electronic device can include a processor 601 with one or more processing cores, a memory 602 with one or more computer readable storage media, a power supply 603, an input module 604, a communication module 605, etc. Those skilled in the art can understand that the electronic device can include more components, and the components of the electronic device will not be described here. Figure 6 The electronic device structure shown in the figures is not intended to limit the electronic device, which can include more or fewer components than shown, or have components combined together or arranged differently. Among others:
[0142] The processor 601 is the control center of the electronic device, which connects various parts of the electronic device through various interfaces and lines, and performs various functions and processes data of the electronic device by running or executing software programs and / or modules stored in the memory 602 and calling data stored in the memory 602, thereby monitoring the entire electronic device. In some embodiments, the processor 601 can include one or more processing cores; in some embodiments, the processor 601 can integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application program, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 601.
[0143] The memory 602 can be used to store software programs and modules, and the processor 601 executes various functions and data processing by running the software programs and modules stored in the memory 602. The memory 602 can mainly include a program storage area and a data storage area, wherein the program storage area can store the operating system, at least one application program required by the function (such as sound playing function, image playing function, etc.), etc.; the data storage area can store data created according to the use of the electronic device, etc. In addition, the memory 602 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device. Accordingly, the memory 602 can also include a memory controller to provide access for the processor 601 to the memory 602.
[0144] The electronic device also includes a power supply 603 for supplying power to various components, and in some embodiments, the power supply 603 can be logically connected to the processor 601 through a power management system, so as to realize the functions of managing charging, discharging, and power consumption management through the power management system. The power supply 603 can also include one or more direct or alternating current power supplies, recharging systems, power failure detection circuits, power converters or inverters, power state indicators, and any other components.
[0145] The electronic device can also include an input module 604, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0146] The electronic device can also include a communication module 605, which in some embodiments can include a wireless module, through which the electronic device can perform short-range wireless transmission, thereby providing the user with wireless broadband Internet access. For example, the communication module 605 can be used to help the user send and receive emails, browse web pages, and access streaming media, etc.
[0147] Although not shown, the electronic device can also include a display unit, etc., which will not be described here. In particular, in the present embodiment, the processor 601 in the electronic device will load the executable file corresponding to the process of one or more application programs into the memory 602 according to the following instructions, and run the application program stored in the memory 602 by the processor 601, thereby realizing various functions, such as:
[0148] Obtaining a latest patch package of an application program, wherein the latest patch package includes a difference record file and a deletion record file, the difference record file is used to record resources newly added and modified resources compared with a previous patch package; the deletion record file is used to record resources deleted compared with the previous patch package; for each patch package stored locally except the latest patch package: comparing the difference record file and the deletion record file corresponding to the preset patch package of the patch package, wherein the preset patch package is all patch packages with installation time later than 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, deleting the patch package; loading the latest patch package into the application program to complete installation of the latest patch package.
[0149] The specific implementation of each operation can refer to the previous embodiments, which will not be described here.
[0150] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by instructions controlling related hardware, which can be stored in a computer readable storage medium and loaded and executed by a processor.
[0151] To this end, an embodiment of the present application provides a computer readable storage medium, which stores a plurality of instructions, which can be loaded by a processor to execute the steps in any patch package installation method provided by an embodiment of the present application. For example, the instructions can perform the following steps:
[0152] The latest patch package of the application program is acquired, wherein the latest patch package comprises a difference record file and a deletion record file, the difference record file is used to record resources added and modified in the latest patch package compared with a previous patch package, and the deletion record file is used to record resources deleted in the latest patch package compared with the previous patch package; for each patch package stored locally except the latest patch package: comparing the patch package with difference record files and deletion record files corresponding to preset patch packages, wherein the preset patch packages are all patch packages installed later than the patch package; if all resources included in the patch package are completely covered by the difference record files and the deletion record files corresponding to the preset patch packages, the patch package is deleted; and the latest patch package is loaded into the application program to complete installation of the latest patch package.
[0153] The storage medium can include a read-only memory (ROM), a random access memory (RAM), a magnetic disk, an optical disk, etc.
[0154] According to an aspect of the present application, a computer program product or computer program is provided, which includes computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in any of the optional implementation manners provided in the above embodiments.
[0155] Since the instructions stored in the storage medium can execute the steps in any of the patch package installation methods provided in the embodiments of the present application, the beneficial effects of any of the patch package installation methods provided in the embodiments of the present application can be achieved, which are described in detail in the above embodiments and will not be repeated here.
[0156] The above describes in detail a patch package installation method, device, electronic device and computer readable storage medium provided in the embodiments of the present application. The principles and implementation manners of the present application are described by applying specific examples in this paper. The above embodiment descriptions are only used to help understand the method of the present application and its core idea; meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation manners and application ranges will be changed; and in summary, the content of the specification should not be understood as a limitation of the present application.
Claims
1. A method for installing a patch package, characterized in that, The method includes: Obtain the application's patch package, wherein each patch package of the application's patch package includes a difference record file and a deletion record file. The difference record file is used to record the resources added and modified in the current patch package compared to the previous patch package; the deletion record file is used to record the resources deleted in the current patch package compared to the previous patch package; wherein the patch package includes each patch package of the application's patch package; For patch packages stored locally other than the latest patch package: Compare the difference record file and deletion record file corresponding to each patch package other than the latest patch package with the preset patch package, wherein the preset patch package is all patch packages whose installation time is later than the patch package to be compared; If all resources included in the current patch package to be compared are completely overwritten by the difference record file and deletion record file corresponding to the preset patch package, then delete the current patch package to be compared; or, If all resources included in the current patch package to be compared are not completely overwritten by the difference record file and deletion record file corresponding to the preset patch package, the current patch package to be compared is retained; The latest patch package is loaded into the application to complete the installation of the latest patch package.
2. The method as described in claim 1, characterized in that, The comparison process between the difference record file and the deletion record file corresponding to each patch package other than the latest patch package and the preset patch package is performed sequentially according to the installation time order of the patch packages.
3. The method as described in claim 2, characterized in that, The installation time sequence of the application's patch packages is recorded in the patch package installation record file corresponding to the application.
4. The method as described in claim 3, characterized in that, After deleting the patch package currently being compared, the method further includes: The corresponding record information for the patch package to be deleted is removed from the patch package installation record file.
5. A method for installing a patch package, characterized in that, The method includes: Obtain the latest version of the application and the resources added and modified compared to the previous version of the application, and package the added and modified resources into a preliminary patch package; Obtain the resource information corresponding to the newly added and modified resources, and record it in the difference record file; Obtain the resource information corresponding to the deleted resources in the latest version of the application compared with the previous version of the application, and record it in the deletion record file; The difference log file, deletion log file, and the initial patch package are sent together to the terminal, wherein the difference log file, deletion log file, and the initial patch package are referred to as the latest patch package. To enable the terminal to: for locally stored patch packages other than the latest patch package: Compare the difference record file and deletion record file corresponding to each patch package other than the latest patch package with the preset patch package, wherein the preset patch package is all patch packages of the patch package to be compared; If all resources included in the current patch package to be compared are completely overwritten by the difference record file and deletion record file corresponding to the preset patch package, then delete the current patch package to be compared; or, If all resources included in the current patch package to be compared are not completely overwritten by the difference record file and deletion record file corresponding to the preset patch package, the current patch package to be compared is retained; The latest patch package is loaded into the application to complete the installation of the latest patch package.
6. The method as described in claim 5, characterized in that, The step of obtaining resource information corresponding to the deleted resources in the latest version of the application compared to the previous version of the application includes: Obtain the current resource information corresponding to the latest version, wherein the current resource information includes information on all resources of the latest version; Obtain the historical resource information corresponding to the previous version, wherein the historical resource information includes information on all resources of the previous version; The current resource information is compared with the historical resource information to obtain the resource information corresponding to the resources deleted in the latest version compared with the previous version.
7. A patch installation device, characterized in that, The device includes: The latest patch package acquisition unit is used to acquire patch packages for the application. Each patch package includes a difference record file and a deletion record file. The difference record file records the resources added and modified in the current patch package compared to the previous patch package. The deletion record file records the resources deleted in the current patch package compared to the previous patch package. The patch package includes the latest patch package and patch packages other than the latest patch package. The comparison unit is used to compare the difference record file and deletion record file corresponding to each patch package other than the latest patch package stored locally with a preset patch package, wherein the preset patch package is the patch package whose installation time is later than the patch package to be compared. The patch package deletion unit is used to delete the patch package to be compared if all resources included in the current patch package to be compared are completely overwritten by the difference record file and deletion record file corresponding to the preset patch package; or, If all resources included in the current patch package to be compared are not completely overwritten by the difference record file and deletion record file corresponding to the preset patch package, the current patch package to be compared is retained; The latest patch installation unit is used to load the latest patch into the application to complete the installation of the latest patch.
8. A patch installation device, characterized in that, The device includes: The initial selection packaging unit is used to obtain the new and modified resources of the latest version of the application compared with the previous version of the application, and package the new and modified resources into an initial selection patch package. The difference file unit is used to obtain the resource information corresponding to the newly added and modified resources, and record it in the difference record file; The file deletion unit is used to obtain resource information corresponding to the deleted resources in the latest version of the application compared with the previous version of the application, and record it in the deletion record file; The latest patch package generation unit is used to send the difference record file, the deletion record file and the initial patch package to the terminal, wherein the difference record file, the deletion record file and the initial patch package are referred to as the latest patch package; To enable the terminal to: for locally stored patch packages other than the latest patch package: Compare the difference record file and deletion record file corresponding to each patch package other than the latest patch package with the preset patch package, wherein the preset patch package is the patch package whose installation time is later than the patch package to be compared; If all resources included in the current patch package to be compared are completely overwritten by the difference record file and deletion record file corresponding to the preset patch package, then delete the current patch package to be compared; or, If all resources included in the current patch package to be compared are not completely overwritten by the difference record file and deletion record file corresponding to the preset patch package, the current patch package to be compared is retained; The latest patch package is loaded into the application to complete the installation of the latest patch package.
9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing multiple instructions; the processor loads instructions from the memory to perform the steps in the patch installation method as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plurality of instructions adapted for loading by a processor to perform the steps of the patch installation method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Downloading method, device, equipment and system of application program service pack
CN110727456A