Method and device for updating application program, electronic device and medium

By comparing application packages on the server and generating upgrade packages, the problems of wasted bandwidth and reduced user experience during application updates are solved, and efficient application updates are achieved.

CN112732312BActive Publication Date: 2025-03-14BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110182267.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-09
Publication Date
2025-03-14
Estimated Expiration
2041-02-09

AI Technical Summary

Technical Problem

During the application update process, the client needs to re-download the full package, resulting in wasted bandwidth and reduced user experience.

Method used

Comparison of application packages on the server, generate description files and record the information of the change files, and generate upgrade packages based on the description files and the new version of the application package, and only update the change parts of the application.

Benefits of technology

It saves enterprise bandwidth and user traffic, improves application update efficiency, and optimizes user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112732312B_ABST
    Figure CN112732312B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method, device, electronic device, computer-readable storage medium and computer program product for updating an application, and relates to the field of computer technology, and in particular to the field of application technology. The implementation scheme is: in response to receiving an application package of a new version of an application, the application package of the new version is compared with the application package of the historical version of the application; a description file is generated according to the comparison result, wherein the description file records information about files that have changed in the new version of the application package relative to the application package of the historical version; and an upgrade package of the application is generated according to the description file and the files that have changed in the new version of the application package.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, in particular to the field of application technology, and specifically to a method, device, electronic device, computer-readable storage medium, and computer program product for updating an application. Background Art

[0002] As the application ecosystem gradually prospers, developers are making more and more modifications to applications. Usually, when updating the client application, the entire package needs to be re-downloaded, even if most of the files already exist on the client. The existence of repeated downloads has caused the bandwidth occupied by the upgrade to continue to grow, seriously wasting bandwidth resources and causing huge cost losses to Internet companies; users consume a lot of unnecessary traffic in the process of updating applications, and the time delay caused by large amounts of data downloads when users open applications also seriously affects the user experience. Summary of the invention

[0003] The present disclosure provides a method, an apparatus, an electronic device, a computer-readable storage medium, and a computer program product for updating an application.

[0004] According to one aspect of the present disclosure, a method for updating an application running on a server is provided, comprising: in response to receiving an application package of a new version of the application, comparing the application package of the new version with the application package of a historical version of the application, generating a description file based on the comparison result, wherein the description file records information about files that have changed in the new version of the application package relative to the application package of the historical version; and generating an upgrade package for the application based on the description file and the changed files in the new version of the application package.

[0005] According to another aspect of the present disclosure, a method for updating an application running on a client is provided, comprising: sending an update request for the application to a server, wherein the update request includes the version number of the current version of the application of the client; in response to determining that there is an application package of a new version corresponding to the application and an upgrade package of the current version of the application, obtaining the upgrade package, wherein the upgrade package includes a description file and files that exist in the new version of the application package and have changed relative to the current version of the application, the description file recording information about files that exist in the new version of the application package and have changed relative to the current version of the application; and updating the application based on the description file and the files that exist in the new version of the application package and have changed relative to the current version of the application.

[0006] According to another aspect of the present disclosure, there is provided a device for updating an application program running on a server side, comprising: a comparison unit, configured to, in response to receiving an application package of a new version of the application program, compare the application package of the new version with the application package of a historical version of the application program; a description file generation unit, configured to generate a description file based on the comparison result, wherein the description file records information about files that have changed in the application package of the new version relative to the application package of the historical version; and an upgrade package generation unit, configured to generate an upgrade package for the application program based on the description file and the changed files in the application package of the new version.

[0007] According to another aspect of the present disclosure, there is provided a device for updating an application running on a client, comprising: a sending unit, configured to send an update request for the application to a server, wherein the update request includes the version number of the current version of the application of the client; an acquiring unit, configured to acquire the upgrade package in response to determining that there is an application package of a new version corresponding to the application and an upgrade package of the current version of the application, wherein the upgrade package includes a description file and files that exist in the new version of the application package and have changed relative to the current version of the application, and the description file records information about files that exist in the new version of the application package and have changed relative to the current version of the application; and an updating unit, configured to update the application based on the description file and files that exist in the new version of the application package and have changed relative to the current version of the application.

[0008] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for updating an application program running on a server side as described in the present disclosure.

[0009] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method for updating an application program running on a server side described in the present disclosure.

[0010] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the computer program implements the method for updating an application program running on a server side described in the present disclosure.

[0011] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for updating an application running on a client as described in the present disclosure.

[0012] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method for updating an application program running on a client as described in the present disclosure.

[0013] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the computer program implements the method for updating an application program running on a client as described in the present disclosure.

[0014] According to one or more embodiments of the present disclosure, only the changed parts of the application can be updated based on the upgrade package, which saves enterprise bandwidth and user traffic, improves the efficiency of application update, and optimizes user experience.

[0015] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.

[0017] Figure 1 A schematic diagram showing an exemplary system in which the various methods described herein may be implemented according to an embodiment of the present disclosure;

[0018] Figure 2 A flow chart of a method for updating an application program running on a server according to an embodiment of the present disclosure is shown;

[0019] Figure 3 A flow chart showing a comparison between a new version of an application package and an application package of a historical version of an application according to an embodiment of the present disclosure;

[0020] Figure 4A flowchart of obtaining one or more latest historical versions of an application package of the application according to an embodiment of the present disclosure is shown;

[0021] Figure 5 A flowchart of comparing the acquired historical version of the application package with the new version of the application package is shown according to an embodiment of the present disclosure;

[0022] Figure 6 A flowchart is shown according to an embodiment of the present disclosure of determining files that have been changed in a new version of an application package relative to a historical version of an application package based on a comparison result;

[0023] Figure 7 A flowchart of generating an upgrade package of an application according to an embodiment of the present disclosure is shown;

[0024] Figure 8 A flowchart of updating an application program on a client based on an upgrade package information table according to an embodiment of the present disclosure is shown;

[0025] Fig. 9 A flowchart of a method for updating an application program executed on a client according to an embodiment of the present disclosure is shown;

[0026] Fig.10 A structural block diagram of a device for updating an application program running on a server according to an embodiment of the present disclosure is shown;

[0027] Fig.11 A structural block diagram of an apparatus for updating an application program running on a client according to an embodiment of the present disclosure is shown; and

[0028] Fig.12 A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0029] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0030] In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, timing relationship, or importance relationship of these elements, and such terms are only used to distinguish one element from another element. In some examples, the first element and the second element may refer to the same instance of the element, and in some cases, based on the description of the context, they may also refer to different instances.

[0031] The terms used in the description of various examples in this disclosure are only for the purpose of describing specific examples and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element can be one or more. In addition, the term "and / or" used in this disclosure covers any one of the listed items and all possible combinations.

[0032] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.

[0033] Figure 1 FIG. 1 is a schematic diagram of an exemplary system 100 in which various methods and apparatuses described herein may be implemented according to an embodiment of the present disclosure. Figure 1 , the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.

[0034] In an embodiment of the present disclosure, the server 120 may run one or more services or software applications that enable execution of the method for updating the application program running on the server side.

[0035] In some embodiments, server 120 may also provide other services or software applications that may include non-virtualized environments and virtualized environments. In some embodiments, these services may be provided as web-based services or cloud services, such as provided to users of client devices 101, 102, 103, 104, 105, and / or 106 under a software as a service (SaaS) model.

[0036] exist Figure 1In the configuration shown, the server 120 may include one or more components that implement the functions performed by the server 120. These components may include software components, hardware components, or a combination thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 may in turn utilize one or more client applications to interact with the server 120 to utilize the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from the system 100. Therefore, Figure 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.

[0037] Client devices 101, 102, 103, 104, 105 and / or 106 may be used to run applications installed thereon, etc. The client devices may provide an interface that enables a user of the client device to interact with the client device. The client device may also output information to the user via the interface. Figure 1 Only six client devices are depicted, but one skilled in the art will appreciate that the present disclosure may support any number of client devices.

[0038] Client devices 101, 102, 103, 104, 105 and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptops), workstation computers, wearable devices, game systems, thin clients, various messaging devices, sensors or other sensing devices, etc. These computer devices may run various types and versions of software applications and operating systems, such as Microsoft Windows, Apple iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as Google Chrome OS); or include various mobile operating systems, such as Microsoft Windows Mobile OS, iOS, Windows Phone, Android. Portable handheld devices may include cellular phones, smart phones, tablet computers, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays and other devices. Game systems may include various handheld game devices, Internet-enabled game devices, etc. Client devices are capable of executing a variety of different applications, such as various Internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and may use various communication protocols.

[0039] The network 110 may be any type of network known to those skilled in the art that may support data communications using any of a variety of available protocols, including but not limited to TCP / IP, SNA, IPX, etc. By way of example only, the one or more networks 110 may be a local area network (LAN), an Ethernet-based network, a token ring, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.

[0040] Server 120 may include one or more general purpose computers, dedicated server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running virtual operating systems, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that may be virtualized to maintain a server's virtual storage device). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.

[0041] The computing units in the server 120 may run one or more operating systems including any of the above operating systems and any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and / or middle-tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.

[0042] In some implementations, server 120 may include one or more applications to analyze and consolidate data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and 106.

[0043] In some embodiments, the server 120 may be a server of a distributed system, or a server combined with a blockchain. The server 120 may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in a cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services.

[0044] The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store any other information for updating applications, such as application packages. For example, one or more of the databases 130 may be used to store information such as upgrade packages, upgrade information tables, and the like. The data repository 130 may reside in various locations. For example, the data repository used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. The data repository 130 may be of different types. In some embodiments, the data repository used by the server 120 may be a database, such as a relational database. One or more of these databases may store, update, and retrieve data to and from the database in response to commands.

[0045] In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the applications may be different types of databases, such as a key-value store, an object store, or a conventional store backed by a file system.

[0046] Figure 1 The system 100 may be configured and operated in various ways to enable the application of various methods and apparatuses described in the present disclosure.

[0047] Usually, when upgrading a mini program, it is necessary to re-download the full package. Most of these files already exist on the client, which is equivalent to repeated downloads, wasting a huge amount of bandwidth resources. Bandwidth is one of the largest costs for Internet companies, which results in huge cost losses. At the same time, the full package data needs to be downloaded, which consumes a lot of unnecessary user traffic and brings a bad user experience to users. Because the upgrade of mini programs is implicit, in most cases the upgrade is performed the moment the mini program is opened, and the upgrade of the full package requires a longer download time, which affects the opening speed of the mini program and seriously affects the user experience.

[0048] Therefore, according to an embodiment of the present disclosure, a method 200 for updating an application program running on a server is provided, such as Figure 2 As shown, the method 200 includes: in response to receiving an application package of a new version of an application, comparing the application package of the new version with the application package of a historical version of the application (step 210); generating a description file based on the comparison result, wherein the description file records information about files that have changed in the new version of the application package relative to the application package of the historical version (step 220); and generating an upgrade package for the application based on the description file and the changed files in the new version of the application package (step 230).

[0049] According to the embodiments of the present disclosure, only the changed parts of the application can be updated based on the upgrade package, which saves enterprise bandwidth and user traffic, improves the efficiency of application update, and optimizes user experience.

[0050] In step 210 , in response to receiving the application package of the new version of the application, the application package of the new version is compared with the application package of the historical version of the application.

[0051] According to some embodiments, Figure 3 As shown, step 210 may include: in response to receiving a new version of an application package, obtaining one or more latest historical version application packages of the application (step 310); and comparing the obtained historical version application packages with the new version application package respectively to determine the files in the new version application package that have changed relative to each historical version application package (step 320).

[0052] According to some embodiments, Figure 4 As shown, obtaining one or more latest historical versions of an application package of an application (step 310) includes: obtaining an identifier of the application corresponding to the new version of the application package (step 410); determining information of the application package of the historical version of the application based on the identifier (step 420); and obtaining one or more latest historical versions of the application package based on the determined application package information (step 430).

[0053] In some examples, the identifier of the application can uniquely specify the corresponding application, for example, the identifier of the application can be an application ID. According to some embodiments, the application in the present disclosure can also be a small program, so the small program package that needs to be compared can be obtained through appkey (the unique identifier of the small program).

[0054] According to some embodiments, determining the application package information of the historical version of the application according to the identifier (step 420) includes: determining the application package information of the historical version of the application based on an application package information table. The application package information table may include the identifier of the application, the version number and storage address of each version of the application.

[0055] In some examples, information of various versions of an application may be summarized in an application package information table, so that information of all versions of the application may be obtained at one time by querying the application package information table. This is convenient and fast, greatly improving the efficiency of data transmission and comparison, and saving application update time.

[0056] In some examples, it is possible to set up a predetermined number of latest historical versions of application packages to be obtained. For example, when a developer submits a new version of an application package to the developer platform, the platform automatically obtains the corresponding historical version of the application package (for example, through the application ID), and obtains the 5 latest historical versions of the application package by default. By obtaining multiple latest historical versions of the application package, even if the client application has not been updated for many times (i.e., it is different from the latest version by multiple versions), the application can still be updated through the method according to the present disclosure.

[0057] According to some embodiments, Figure 5 As shown, comparing the obtained historical version of the application package with the new version of the application package respectively (step 320) includes: calculating each file in the historical version of the application package and the new version of the application package respectively through a verification algorithm (step 510); comparing the calculated files in the historical version of the application package with the calculated files in the new version of the application package (step 520); and determining the files in the new version of the application package that have changed relative to the historical version of the application package based on the comparison results (step 530).

[0058] For example, the version numbers corresponding to the historical versions of the application packages obtained are 2, 3, and 4, respectively, and the version number of the new version of the application package uploaded by the developer is 5. The files in each version of the application package are calculated by the verification algorithm and then compared. That is, the application package with version number 2 is compared with each file in the new version of the application package with version number 5, the application package with version number 3 is compared with each file in the new version of the application package with version number 5, and the application package with version number 4 is compared with each file in the new version of the application package with version number 5, so as to confirm that the new version of the application package corresponds to each historical version of the application package through comparison. There are changed file information.

[0059] Files with the same name and location in different versions of application packages are calculated using a verification algorithm. If the contents of the two files are exactly the same, the calculated values ​​should also be the same; if the contents of the two files are changed, the calculated values ​​should also be different. This allows the information of the changed files to be quickly and accurately determined.

[0060] According to some embodiments, the changed files include one or more of the following groups: updated files, newly added files, and deleted files. Figure 6As shown, determining the files that have changed in the new version of the application package relative to the historical version of the application package based on the comparison result (step 530) includes: in response to the different calculation results of the files with the same name and location in the historical version of the application package and the new version of the application package, determining that the files in the new version of the application package are updated files relative to the historical version of the application package (step 610); in response to the files only existing in the new version of the application package, determining that the files in the new version of the application package are newly added files relative to the historical version of the application package (step 620); and in response to the files only existing in the historical version of the application package, determining that the files in the historical version of the application package are deleted files relative to the new version of the application package (step 630). Steps 610 to 630 are not used to indicate the order of their execution, but are only used to indicate various situations that may occur during the comparison process.

[0061] That is, for the historical version of the application package and the new version of the application package, the files with the same position and the same name in the two application packages are verified through a verification algorithm and then their values ​​are compared. If the calculated values ​​are the same, they are recorded as the same files; if they are different, they are recorded as updated files; if a file only exists in the new version of the application package, the file is recorded as a newly added file; if a file only exists in the historical version of the application package, the file is recorded as a deleted file.

[0062] By comparing the files in the new version of the application package with the files in the previous version of the application package, it is possible to determine which files have been updated, deleted, or added to the new version of the application package, so that a complete update or upgrade from the previous version to the new version can be achieved based on the comparison results. Based on this, it can not only save the bandwidth and traffic consumed when updating the application, but also improve the update efficiency of the application and the user experience.

[0063] According to some embodiments, the verification algorithm includes any one of the following group: md5 algorithm, sha1 algorithm, sha256 algorithm, mssql algorithm. Of course, it should be understood that other suitable verification algorithms are also possible and are not limited here.

[0064] For example, the md5 algorithm can be used to calculate each file in the historical version of the application package and the new version of the application package. The md5 value obtained after calculation is a unique value calculated by the file attribute and the algorithm. This value will change after the file or folder is changed, so it can be used as a means of verifying whether a file has been modified.

[0065] In step 220, a description file is generated according to the comparison result, and the description file records information about files that have been changed in the new version of the application package relative to the historical version of the application package.

[0066] In some examples, the list of files in one of the historical versions of the application package obtained is as follows:

[0067]

[0068] The file list in the new version of the application package is as follows, where " / / update" indicates that the file content is updated compared to the historical version.

[0069]

[0070]

[0071] According to the comparison process described above, app.json, pkginfo.json, and page / home / index.html are recorded as updated files, page / home / indexa.js is recorded as a newly added file, and images / api.png is recorded as a deleted file. Thus, a description file can be generated. The description file obtained based on the above example is as follows:

[0072]

[0073] In this way, the client application can be updated and upgraded according to the description file later.

[0074] In step 230, an upgrade package of the application is generated based on the description file and the changed files in the new version of the application package.

[0075] According to some embodiments, Figure 7 As shown, step 230 may include: packaging the description file and the changed files in the new version of the application package to obtain an upgrade package (step 710); and storing the information of the upgrade package in the upgrade package information table to update the application of the client based on the upgrade package information table (step 720). For example, the upgrade package information table may include the respective version numbers of the new version of the application package and the historical version of the application package corresponding to the upgrade package, the identifier of the application, and the storage address of the upgrade package.

[0076] The description file and the new and updated files in the new version of the application package are packaged together. In this way, when the client application needs to be updated later, the description file and the changed files in the new version of the application package can be obtained at the same time, so that the client application can be updated based on the description file and the changed files, saving traffic and update time, and improving update efficiency and user experience.

[0077] In some examples, the description file obtained and the files that need to be updated and added to the client application can be packaged into a compressed file as an upgrade package. The naming format of the compressed file can be: the version number of the corresponding historical version-the version number of the new version. Subsequently, based on the corresponding version number, the upgrade package corresponding to the current version of the client (not updated, as the historical version) and the new version newly developed by the developer can be obtained to update the client application based on the upgrade package.

[0078] According to some embodiments, the method 200 of the present disclosure may further include: performing real machine detection on the generated upgrade package to update the client application based on the real machine detection result. Through real machine detection, the risk of failure in the update operation can be reduced, greatly optimizing the user experience.

[0079] In some examples, the upgrade package that passes the real machine detection is stored and the information of the upgrade package is stored in the upgrade package information table for subsequent update and upgrade of the client application.

[0080] According to some embodiments, the method 200 according to the present disclosure may further include: receiving an update request for the application from a client. The update request may include a version number of the current version of the application of the client. In some examples, such as Figure 8 As shown, updating the client's application based on the upgrade package information table (step 720) may include: determining the new version of the application package corresponding to the application based on the version number of the current version of the application of the client (step 810); in response to the existence of the new version of the application package, determining the upgrade package corresponding to the new version of the application package and the current version of the application based on the upgrade package information table (step 820); and in response to the existence of the upgrade package corresponding to the new version of the application package and the current version of the application, obtaining the upgrade package so that the client's application is updated based on the upgrade package (step 830).

[0081] Based on the version number of the client and the version number of the latest version of the application package, the corresponding upgrade package can be accurately located, thereby achieving rapid update and upgrade of the client application.

[0082] According to some embodiments, the application is updated based on a content distribution network.

[0083] In some examples, the application packages of various versions uploaded by the developer and the upgrade packages produced can be stored in the content delivery network (CDN) server. A content delivery network refers to a computer network system interconnected by the Internet, which provides a high-performance, scalable, and low-cost network to deliver content to clients. The content distribution network widely uses various servers, distributes these servers to areas or networks where client access is relatively concentrated, and uses global load balancing technology to direct the client's access to the server that is closest to the client and works normally, and the server directly responds to the client's request. If the content distribution network server does not have the content that the client wants to access or obtain, it will automatically go to the original server to grab the corresponding content and provide it to the client according to the configuration. Therefore, the content distribution network will greatly improve the response speed of client requests, save time for upgrading applications, and further improve the client's user experience.

[0084] According to an embodiment of the present disclosure, a method 900 for updating an application program executed on a client is also provided. Fig. 9 As shown, it includes: sending an update request for the application to the server, wherein the update request includes the version number of the current version of the application of the client (step 910); in response to determining that there is a new version of the application package corresponding to the application and an upgrade package for the current version of the application, obtaining the upgrade package, wherein the upgrade package includes a description file and files that exist in the new version of the application package and have changed relative to the current version of the application, and the description file records information about the files that exist in the new version of the application package and have changed relative to the current version of the application (step 920); and updating the application based on the description file and the files that exist in the new version of the application package and have changed relative to the current version of the application (step 930).

[0085] According to some embodiments, the files with changes include one or more of the following groups: updated files, newly added files, and deleted files. If the files with the same name and location in the historical version of the application package and the new version of the application package are different, then the file in the new version of the application package is an updated file relative to the historical version of the application package; if the file only exists in the new version of the application package, then the file in the new version of the application package is a newly added file relative to the historical version of the application package; and if the file only exists in the historical version of the application package, then the file in the historical version of the application package is a deleted file relative to the new version of the application package.

[0086] In the example of a client user updating a mini-program, when the user opens the client mini-program, he or she will request the server to view the update status of the mini-program. The request parameters include the version number (application package ID) of the current version of the mini-program and the identifier appkey of the mini-program. Upon receiving the request, the server will check whether there is a new mini-program package updated by the developer. If so, it will return is_update=1 and the version number of the new version. At the same time, it will check whether there is an upgrade package from the current version to the latest version, and decide whether to pass the real machine detection based on the real machine detection result. If so and the detection is safe, it will return is_patch=1. The client receives the returned result and performs corresponding operations based on the result. If no update is required (is_update=0), the existing mini-program is opened directly; if an update is required and an upgrade package is available (is_patch=1), the corresponding upgrade package is obtained (for example, through a CDN server).

[0087] After obtaining the upgrade package and decompressing it, read the description file and perform the update operation according to the description in the description file. Based on the example described above, the update process is as follows: replace the app.json, pkginfo.json, and page / home / index.html files (existing in the new version) in the upgrade package with the current version of the mini program package; add the page / home / indexa.js file (existing in the new version) in the upgrade package to the current version of the mini program package; delete the images / api.png file in the current version of the mini program package. After the execution is completed, you can open the mini program to execute the latest version.

[0088] According to an embodiment of the present disclosure, there is also provided a device 1000 for updating an application program running on a server, such as Fig.10 As shown, it includes: a comparison unit 1010, configured to, in response to receiving an application package of a new version of the application, compare the application package of the new version with the application package of the historical version of the application; a description file generation unit 1020, configured to generate a description file according to the comparison result, wherein the description file records information about files that have changed in the new version of the application package relative to the application package of the historical version; and an upgrade package generation unit 1030, configured to generate an upgrade package for the application according to the description file and the changed files in the new version of the application package.

[0089] According to some embodiments, the comparison unit 1010 may include: a unit that calculates each file in the historical version of the application package and the new version of the application package through a verification algorithm respectively; a unit that compares the calculated files in the historical version of the application package with the calculated files in the new version of the application package; and a unit that determines the files in the new version of the application package that have changed relative to the historical version of the application package based on the comparison results.

[0090] Here, the operations of the above-mentioned units 1010-1030 of the device 1000 for updating an application program running on the server are respectively similar to the operations of the steps 210-230 described above, and will not be repeated here.

[0091] According to an embodiment of the present disclosure, there is also provided a device 1100 for updating an application program running on a client, such as Fig.11 As shown, it includes: a sending unit 1110, configured to send an update request for the application to a server, wherein the update request includes the version number of the current version of the application of the client; an obtaining unit 1120, configured to obtain the upgrade package in response to determining that there is a new version of the application package corresponding to the application and an upgrade package of the current version of the application, wherein the upgrade package includes a description file and files that exist in the new version of the application package and are changed relative to the current version of the application, and the description file records information about the files that exist in the new version of the application package and are changed relative to the current version of the application; and an updating unit 1130, configured to update the application based on the description file and the files that exist in the new version of the application package and are changed relative to the current version of the application.

[0092] Here, the operations of the above-mentioned units 1110 to 1130 of the apparatus 1100 for updating an application program running on the client are respectively similar to the operations of the steps 910 to 930 described above, and are not described in detail here.

[0093] According to an embodiment of the present disclosure, an electronic device, a readable storage medium and a computer program product are also provided.

[0094] refer to Fig.12, a block diagram of an electronic device 1200 that can serve as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0095] like Fig.12 As shown, the device 1200 includes a computing unit 1201, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1202 or a computer program loaded from a storage unit 1208 into a random access memory (RAM) 1203. In the RAM 1203, various programs and data required for the operation of the device 1200 can also be stored. The computing unit 1201, the ROM 1202, and the RAM 1203 are connected to each other via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.

[0096] Multiple components in the device 1200 are connected to the I / O interface 1205, including: an input unit 1206, an output unit 1207, a storage unit 1208, and a communication unit 1209. The input unit 1206 can be any type of device that can input information to the device 1200. The input unit 1206 can receive input digital or character information, and generate key signal input related to user settings and / or function control of the electronic device, and can include but is not limited to a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and / or a remote controller. The output unit 1207 can be any type of device that can present information, and can include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 1208 can include but is not limited to a disk and an optical disk. The communication unit 1209 allows the device 1200 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and may include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver and / or a chipset, such as a Bluetooth™ device, a 1302.11 device, a WiFi device, a WiMax device, a cellular communication device and / or the like.

[0097] The computing unit 1201 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1201 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1201 performs the various methods and processes described above, such as methods 200 and 900. For example, in some embodiments, the method 200 may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 1208. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1200 via the ROM 1202 and / or the communication unit 1209. When the computer program is loaded into the RAM 1203 and executed by the computing unit 1201, one or more steps of the method 200 described above may be performed. Alternatively, in other embodiments, the computing unit 1201 may be configured to execute the methods 200 , 900 in any other appropriate manner (eg, by means of firmware).

[0098] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0099] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0100] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0101] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0102] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0103] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.

[0104] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0105] Although the embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-mentioned methods, systems and devices are merely exemplary embodiments or examples, and the scope of the present invention is not limited by these embodiments or examples, but only by the claims after authorization and their equivalent scope. Various elements in the embodiments or examples can be omitted or replaced by their equivalent elements. In addition, each step can be performed in an order different from that described in the present disclosure. Further, the various elements in the embodiments or examples can be combined in various ways. It is important that with the evolution of technology, many elements described herein can be replaced by equivalent elements that appear after the present disclosure.

Claims

1. A method for updating an application program running on a server, wherein the application program is a mini-program, wherein the method comprises: In response to receiving an application package of a new version of the application, comparing the application package of the new version with an application package of a historical version of the application, including: Calculate each file in the historical version of the application package and the new version of the application package respectively through a verification algorithm, wherein the information of the application package of the historical version of the application is determined based on an application package information table, wherein the application package information table includes an identifier of the application, version numbers of each version of the application, and storage addresses; Comparing the calculated files in the historical version of the application package with the calculated files in the new version of the application package; and Determine, based on the comparison result, that the new version of the application package has changed files relative to the historical version of the application package, wherein the changed files include one or more of the following groups: updated files, newly added files, and deleted files, wherein, based on the comparison result, determine that the new version of the application package has changed files relative to the historical version of the application package, including: In response to different calculation results of files with the same name and location in the historical version of the application package and the new version of the application package, determining that the file in the new version of the application package is an updated file relative to the historical version of the application package; In response to the file only existing in the new version of the application package, determining that the file in the new version of the application package is a newly added file relative to the historical version of the application package; and In response to the file only existing in the application package of the historical version, determining that the file in the application package of the historical version is a deleted file relative to the application package of the new version; generating a description file according to the comparison result, wherein the description file records information about files in which the new version of the application package is changed relative to the historical version of the application package; and Generating an upgrade package of the application program according to the description file and the changed files in the new version of the application program package includes: Packing the description file and the changed files in the new version of the application package to obtain an upgrade package; and The information of the upgrade package is stored in an upgrade package information table, so as to update the application program of the client based on the upgrade package information table, wherein the upgrade package information table includes the respective version numbers of the new version application program package and the historical version application program package corresponding to the upgrade package, the identifier of the application program, and the storage address of the upgrade package, wherein: Updating the application program of the client based on the upgrade package information table includes: Determining an application package corresponding to a new version of the application according to a version number of a current version of the application, wherein the version number of the current version of the application is obtained by receiving an update request for the application from a client; In response to the existence of the new version of the application package, determining, according to the upgrade package information table, an upgrade package corresponding to the new version of the application package and the current version of the application; and In response to the existence of an upgrade package corresponding to the new version of the application package and the current version of the application, the upgrade package is obtained so as to update the application of the client based on the upgrade package.

2. The method of claim 1, wherein: Comparing the new version of the application package with the application package of the historical version of the application includes: In response to receiving the new version of the application package, obtaining one or more latest historical version application packages of the application; and The acquired historical version of the application package is compared with the new version of the application package respectively to determine the files in the new version of the application package that are changed relative to the application packages of each historical version.

3. The method of claim 2, wherein: Obtaining the application package of one or more latest historical versions of the application includes: Obtaining an identifier of the application corresponding to the new version of the application package; Determining information of an application package of a historical version of the application according to the identifier; and The one or more latest historical version application packages are obtained according to the determined information of the application packages.

4. The method of claim 1, wherein: The verification algorithm includes any one of the following group: md5 algorithm, sha1 algorithm, sha256 algorithm, mssql algorithm.

5. The method of claim 1, wherein: The application is updated based on a content distribution network.

6. The method of claim 1, further comprising: The generated upgrade package is subjected to real machine detection to update the application program of the client based on the real machine detection result.

7. A method for updating an application program running on a client, wherein the application program is a small program, wherein the method comprises: Sending an update request for the application to the server, wherein the update request includes the version number of the current version of the application on the client; In response to determining, according to an upgrade package information table, that there exists an application package of a new version corresponding to the application and an upgrade package of the current version of the application, the upgrade package is obtained, wherein the upgrade package information table includes the respective version numbers of the application package of the new version and the application package of the historical version corresponding to the upgrade package, the identification of the application and the storage address of the upgrade package, wherein the upgrade package includes a description file and files that exist in the application package of the new version and that have changed relative to the current version of the application, wherein the description file records information about files that exist in the application package of the new version and that have changed relative to the current version of the application, wherein the files that have changed include one or more of the group consisting of: updated files, newly added files and deleted files, wherein If the files with the same names and locations in the historical version of the application package and the new version of the application package are different, then the files in the new version of the application package are updated files relative to the historical version of the application package; If the file only exists in the new version of the application package, then the file in the new version of the application package is a newly added file relative to the historical version of the application package; and If the file only exists in the application package of the historical version, then relative to the application package of the new version, the file in the application package of the historical version is a deleted file; and The application is updated based on the description file and the files in the new version of the application package that are changed relative to the current version of the application.

8. A device for updating an application program running on a server, wherein the application program is a small program, wherein the device comprises: The comparison unit is configured to, in response to receiving an application package of a new version of the application, compare the application package of the new version with an application package of a historical version of the application, comprising: Calculate each file in the historical version of the application package and the new version of the application package respectively through a verification algorithm, wherein the information of the application package of the historical version of the application is determined based on an application package information table, wherein the application package information table includes an identifier of the application, version numbers of each version of the application, and storage addresses; Comparing the calculated files in the historical version of the application package with the calculated files in the new version of the application package; and Determine, based on the comparison result, that the new version of the application package has changed files relative to the historical version of the application package, wherein the changed files include one or more of the following groups: updated files, newly added files, and deleted files, wherein, based on the comparison result, determine that the new version of the application package has changed files relative to the historical version of the application package, including: In response to different calculation results of files with the same name and location in the historical version of the application package and the new version of the application package, determining that the file in the new version of the application package is an updated file relative to the historical version of the application package; In response to the file only existing in the new version of the application package, determining that the file in the new version of the application package is a newly added file relative to the historical version of the application package; and In response to the file only existing in the application package of the historical version, determining that the file in the application package of the historical version is a deleted file relative to the application package of the new version; a description file generating unit configured to generate a description file according to the comparison result, wherein the description file records information about files in which the new version of the application package is changed relative to the historical version of the application package; and An upgrade package generating unit is configured to generate an upgrade package of the application according to the description file and the changed files in the new version of the application package, including: Packing the description file and the changed files in the new version of the application package to obtain an upgrade package; and The information of the upgrade package is stored in an upgrade package information table, so as to update the application program of the client based on the upgrade package information table, wherein the upgrade package information table includes the respective version numbers of the new version application program package and the historical version application program package corresponding to the upgrade package, the identifier of the application program, and the storage address of the upgrade package, wherein: Updating the application program of the client based on the upgrade package information table includes: Determining an application package corresponding to a new version of the application according to a version number of a current version of the application, wherein the version number of the current version of the application is obtained by receiving an update request for the application from a client; In response to the existence of the new version of the application package, determining, according to the upgrade package information table, an upgrade package corresponding to the new version of the application package and the current version of the application; and In response to the existence of an upgrade package corresponding to the new version of the application package and the current version of the application, the upgrade package is obtained so as to update the application of the client based on the upgrade package.

9. A device for updating an application program running on a client, wherein the application program is a small program, wherein the device comprises: A sending unit, configured to send an update request for the application to the server, wherein the update request includes a version number of a current version of the application of the client; An acquisition unit is configured to acquire the upgrade package in response to determining that there is an application package of a new version corresponding to the application and an upgrade package of the current version of the application according to an upgrade package information table, wherein the upgrade package information table includes the respective version numbers of the new version of the application package and the historical version of the application package corresponding to the upgrade package, the identification of the application and the storage address of the upgrade package, wherein the upgrade package includes a description file and files that exist in the new version of the application package and are changed relative to the current version of the application, the description file records information about files that exist in the new version of the application package and are changed relative to the current version of the application, and the files that are changed include one or more of the group consisting of: updated files, newly added files and deleted files, wherein If the files with the same names and locations in the historical version of the application package and the new version of the application package are different, then the files in the new version of the application package are updated files relative to the historical version of the application package; If the file only exists in the new version of the application package, then the file in the new version of the application package is a newly added file relative to the historical version of the application package; and If the file only exists in the application package of the historical version, then relative to the application package of the new version, the file in the application package of the historical version is a deleted file; and An updating unit is configured to update the application based on the description file and the files in the new version of the application package that are changed relative to the current version of the application.

10. An electronic device comprising: at least one processor; as well as a memory communicatively coupled to the at least one processor; in The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.

11. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-6.

12. A computer program product comprising a computer program, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

13. An electronic device comprising: at least one processor; as well as a memory communicatively coupled to the at least one processor; in The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of claim 7.

14. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to claim 7.

15. A computer program product comprising a computer program, wherein: The computer program implements the method of claim 7 when executed by a processor.

Citation Information

Patent Citations

  • Upgrading method and system of client side application program and client side

    CN104915220A

  • Application program updating method and device, computer equipment and storage medium

    CN110162319A