Application updating method and device, computer equipment, storage medium and program product
By using a modular approach and a snapshot mechanism for application updates, the problem of low efficiency in desktop application updates has been solved. This approach enables efficient, secure, and user-friendly dynamic updates of multiple modules via snapshots, improving update efficiency and user experience, and enhancing system security and fault tolerance.
Patent Information
- Application Number
- CN202511772744.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-03-06
AI Technical Summary
Existing desktop application update methods are inefficient, provide a poor user experience, and cannot meet the high-frequency update needs of modern applications.
Through module partitioning and snapshot mechanisms, the client loads module snapshots according to user instructions, obtains the latest snapshots using the server interface and performs legality verification, and updates based on the module dependency graph to achieve dynamic updates.
It improves the efficiency of application updates and user experience, increases system security and fault tolerance, prevents source code leaks, and ensures stable application operation.
Smart Images

Figure CN121614162A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software engineering technology, and in particular to an application update method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Technology
[0002] Existing desktop applications typically update by requiring users to reinstall the entire client. This approach is inefficient and provides a poor user experience. While some frameworks offer basic update mechanisms, their flexibility and efficiency remain limited, and users are required to wait for updates, failing to meet the high-frequency update needs of modern applications while ensuring a good user experience.
[0003] Current application update methods suffer from low update efficiency. Summary of the Invention
[0004] Therefore, it is necessary to provide an application update method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve update efficiency in response to the above-mentioned technical problems.
[0005] Firstly, this application provides an application update method applied to a client, comprising:
[0006] Based on the user's launch command, determine the target application that the user wants to activate;
[0007] Based on the application identifier information of the target application, load the snapshots of each module corresponding to the target application from the local directory of the client;
[0008] Obtain the latest module snapshot through the server-side interface and verify the validity of the latest module snapshot;
[0009] If the latest module snapshot passes the validity check, the snapshots of each module corresponding to the target application are updated based on the pre-built module dependency graph and the latest module snapshot.
[0010] In one embodiment, the local directory includes a cache directory and a raw resource directory; according to the application identifier information of the target application, snapshots of each module corresponding to the target application are loaded from the client's local directory, including:
[0011] If the cache directory contains snapshots of each module corresponding to the target application, load the snapshots of each module corresponding to the target application from the cache directory according to the application identifier information of the target application.
[0012] If the cache directory does not contain snapshots of the modules corresponding to the target application, load the pre-packaged snapshots of the modules corresponding to the target application from the original resource directory according to the application identifier information of the target application.
[0013] In one embodiment, the original resource catalog is constructed through the following steps:
[0014] The client application is divided into core modules, functional modules, and UI modules;
[0015] Package the core modules, functional modules, and UI modules separately to obtain snapshots of each module in the application;
[0016] The original resource catalog is constructed based on the snapshots of each module corresponding to each application.
[0017] In an exemplary embodiment, the latest module snapshot is obtained through a server-side interface, and the validity of the latest module snapshot is verified, including:
[0018] Obtain the first and latest module snapshot encrypted using the private key in the key pair through the server-side interface;
[0019] Based on the public key in the pre-stored key pair, the encrypted first latest module snapshot is decrypted to obtain the second latest module snapshot;
[0020] Based on the first and second latest module snapshots, verify the authenticity of the second latest module snapshot;
[0021] If the authenticity verification is passed, a hash calculation is performed on the second latest module snapshot;
[0022] The integrity of the second latest module snapshot is verified based on the hash value corresponding to the second latest module snapshot and the hash value corresponding to the first latest module snapshot.
[0023] In one embodiment, the snapshots of each module corresponding to the target application are updated based on a pre-built module dependency graph and the latest module snapshot, including:
[0024] Update the target module snapshot in each module snapshot using the latest module snapshot;
[0025] Based on the target module corresponding to the target module snapshot, the associated modules that have a dependency relationship with the target module are determined from the module dependency graph;
[0026] Update the version information of the associated module snapshots according to the version information of the target module snapshot.
[0027] In one embodiment, the method further includes:
[0028] If the latest module snapshot passes the validity check, update the corresponding module snapshot in the cache directory using the latest module snapshot;
[0029] If the latest module snapshot fails the validity check, return the pre-packaged module snapshots corresponding to the target application from the original resource directory according to the application identifier information of the target application.
[0030] Secondly, this application also provides an application update device for use on a client, comprising:
[0031] The application determination module is used to determine the target application to be activated by the user based on the user's activation command.
[0032] The snapshot loading module is used to load snapshots of each module corresponding to the target application from the client's local directory according to the application identification information of the target application.
[0033] The snapshot verification module is used to obtain the latest module snapshot through the server interface and verify the validity of the latest module snapshot;
[0034] The snapshot update module is used to update the snapshots of each module corresponding to the target application based on the pre-built module dependency graph and the latest module snapshot, provided that the latest module snapshot has passed the validity verification.
[0035] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0036] Based on the user's launch command, determine the target application that the user wants to activate;
[0037] Based on the application identifier information of the target application, load the snapshots of each module corresponding to the target application from the local directory of the client;
[0038] Obtain the latest module snapshot through the server-side interface and verify the validity of the latest module snapshot;
[0039] If the latest module snapshot passes the validity check, the snapshots of each module corresponding to the target application are updated based on the pre-built module dependency graph and the latest module snapshot.
[0040] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0041] Based on the user's launch command, determine the target application that the user wants to activate;
[0042] Based on the application identifier information of the target application, load the snapshots of each module corresponding to the target application from the local directory of the client;
[0043] Obtain the latest module snapshot through the server-side interface and verify the validity of the latest module snapshot;
[0044] If the latest module snapshot passes the validity check, the snapshots of each module corresponding to the target application are updated based on the pre-built module dependency graph and the latest module snapshot.
[0045] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0046] Based on the user's launch command, determine the target application that the user wants to activate;
[0047] Based on the application identifier information of the target application, load the snapshots of each module corresponding to the target application from the local directory of the client;
[0048] Obtain the latest module snapshot through the server-side interface and verify the validity of the latest module snapshot;
[0049] If the latest module snapshot passes the validity check, the snapshots of each module corresponding to the target application are updated based on the pre-built module dependency graph and the latest module snapshot.
[0050] The aforementioned application update method, apparatus, computer equipment, computer-readable storage medium, and computer program product determine the target application to be activated by the user based on a user-initiated startup command. According to the application identifier information of the target application, they load snapshots of each module corresponding to the target application from the client's local directory. The latest module snapshot is obtained through a server-side interface, and its validity is verified. If the latest module snapshot passes the validity verification, the snapshots of each module corresponding to the target application are updated based on a pre-built module dependency graph and the latest module snapshot. By performing pre-module partitioning of the application and loading and updating module snapshots according to the partitioned modules, efficient, secure, and user-friendly dynamic updates of multiple module snapshots are achieved, improving application update efficiency and user experience. Simultaneously, system security and fault tolerance are increased, and source code leakage is effectively prevented. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0052] Figure 1 This is an application environment diagram of the update method in one embodiment;
[0053] Figure 2 This is a flowchart illustrating the application of the update method in one embodiment;
[0054] Figure 3 This is a schematic diagram of the application update interaction process in one embodiment;
[0055] Figure 4 This is a structural block diagram of an application update device in one embodiment;
[0056] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0057] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0058] The application update method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, client 102 communicates with server 104 via a network. A data storage system stores the data that server 104 needs to process. This data storage system can be integrated onto server 104 or hosted on the cloud or other network servers. Based on the user-initiated startup command, client 102 determines the target application to be activated. According to the application identifier information of the target application, it loads snapshots of each module corresponding to the target application from the client's local directory. It obtains the latest module snapshot through the network interface of server 104 and verifies its validity. If the latest module snapshot passes the validity verification, it updates the snapshots of each module corresponding to the target application based on a pre-built module dependency graph and the latest module snapshot. Client 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, and projection devices. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. Headset devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. Server 104 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services.
[0059] In one exemplary embodiment, such as Figure 2 As shown, an application update method is provided, which is applied to... Figure 1 Taking client 102 as an example, the explanation includes the following steps S201 to S204. Wherein:
[0060] Step S201: Based on the startup command initiated by the user, determine the target application to be activated by the user.
[0061] The target application can be understood as a desktop application adapted to the user's intent.
[0062] For example, a user opens client 102 and initiates a launch command, and client 102 determines the target application to be launched by the user based on the launch command.
[0063] Step S202: Load the snapshots of each module corresponding to the target application from the local directory of the client according to the application identification information of the target application.
[0064] Among them, application identification information can be understood as a unique identifier corresponding to the application, used to distinguish different applications; module snapshot can be understood as a snapshot file of the application module that needs to be dynamically updated, compiled by the mk-snapshot tool.
[0065] Optionally, the client 102 determines whether there is a corresponding module snapshot in the client's cache directory according to the application identifier information of the target application. If it exists, the client records the snapshots of each module corresponding to the target application from the cache directory. If it does not exist, the client loads the snapshots of each module corresponding to the target application from the client's original resource directory according to the application identifier information.
[0066] Step S203: Obtain the latest module snapshot through the server interface and verify the validity of the latest module snapshot.
[0067] Among them, legality verification can be understood as verifying the authenticity and integrity of the received information.
[0068] For example, server 104 encrypts the encrypted first latest module snapshot using the private key in the key pair and sends the encrypted first latest module snapshot to client 102 through the server interface. Client 102 decrypts the encrypted first latest module snapshot using the public key in the key pair to obtain a second latest module snapshot. Using the first and second latest module snapshots, the authenticity of the second latest module snapshot is verified. If the authenticity verification is passed, a hash calculation is performed on the second latest module snapshot. Based on the hash value corresponding to the second latest module snapshot and the hash value of the first latest module snapshot, the integrity of the second latest module snapshot is verified.
[0069] Step S204: If the latest module snapshot passes the validity check, update the snapshots of each module corresponding to the target application according to the pre-built module dependency graph and the latest module snapshot.
[0070] The module dependency graph can be understood as a directed acyclic graph (DAG) structure that describes the dependencies between module snapshots.
[0071] Optionally, if the second latest module snapshot passes the integrity verification, the client 102 updates the corresponding module snapshot in the cache directory to the second latest module snapshot, updates the corresponding target module snapshot of the current application, and identifies the associated modules that have a dependency relationship with the target module snapshot from the pre-built module dependency graph, and updates the version information of the module snapshots of the associated modules according to the version information of the target module snapshot.
[0072] In the aforementioned application update method, the target application to be activated by the user is determined based on the user-initiated startup command. According to the application identifier information of the target application, snapshots of each module corresponding to the target application are loaded from the client's local directory. The latest module snapshot is obtained through a server-side interface, and its validity is verified. If the latest module snapshot passes the validity verification, the snapshots of each module corresponding to the target application are updated based on a pre-built module dependency graph and the latest module snapshot. By performing pre-module partitioning of the application and loading and updating module snapshots according to the partitioned modules, efficient, secure, and user-friendly dynamic updates of multiple module snapshots are achieved, improving application update efficiency and user experience. Simultaneously, system security and fault tolerance are increased, and source code leakage is effectively prevented.
[0073] In one embodiment, the local directory includes a cache directory and an original resource directory; loading snapshots of each module corresponding to the target application from the client's local directory according to the application identification information of the target application includes: if snapshots of each module corresponding to the target application are cached in the cache directory, loading snapshots of each module corresponding to the target application from the cache directory according to the application identification information of the target application; if snapshots of each module corresponding to the target application are not cached in the cache directory, loading pre-packaged snapshots of each module corresponding to the target application from the original resource directory according to the application identification information of the target application.
[0074] The cache directory can be understood as a memory module that stores processed, readily accessible copies of resources, while the original resource directory can be understood as a database that stores unprocessed, initial copies of resource files or data.
[0075] For example, client 102 first determines whether the cache directory in the local directory caches snapshots of each module corresponding to the target application. If the cache directory does cache snapshots of each module corresponding to the target application, the client loads the snapshots of each module corresponding to the target application from the cache directory according to the application identifier information of the target application. If the cache directory does not cache snapshots of each module corresponding to the target application, the client loads the pre-packaged snapshots of each module corresponding to the target application from the original resource directory in the local directory according to the application identifier information of the target application. By loading the snapshots of each module corresponding to the target application from the cache directory and the original resource directory in the local directory, the startup speed of the target application is accelerated, thereby accelerating the response speed to user requests.
[0076] In one embodiment, the original resource catalog is constructed through the following steps: dividing the client application into core modules, functional modules, and UI modules; packaging the core modules, functional modules, and UI modules respectively to obtain snapshots of each module corresponding to the application; and constructing the original resource catalog based on the snapshots of each module corresponding to each application.
[0077] Among them, the core module can be understood as the module that undertakes the core capabilities or core business logic of the system, the functional module can be understood as the module that integrates a certain function of the system, and the UI (User Interface) module can be understood as the visualization module that provides user interaction.
[0078] Optionally, client 102 divides the application on it into core modules, functional modules, and UI modules, and packages each module independently into a snapshot file to obtain snapshots of each module corresponding to the application. Finally, the snapshots of each module corresponding to each application are stored in the resource directory to obtain the original resource directory in client 102. By using snapshots, the source code is compiled into binary format to prevent source code leakage and protect intellectual property rights.
[0079] In an exemplary embodiment, obtaining the latest module snapshot through a server-side interface and performing a validity check on the latest module snapshot includes: obtaining a first latest module snapshot encrypted using the private key in a key pair through the server-side interface; decrypting the encrypted first latest module snapshot using the public key in a pre-stored key pair to obtain a second latest module snapshot; performing a validity check on the second latest module snapshot based on the first and second latest module snapshots; performing a hash calculation on the second latest module snapshot if the validity check is passed; and performing a validity check on the second latest module snapshot based on the hash value corresponding to the second latest module snapshot and the hash value corresponding to the first latest module snapshot.
[0080] In this context, a key pair can be understood as a combination of a "key" and a "lock". The private key in the key pair can be understood as the "lock", and the public key in the key pair can be understood as the "key".
[0081] For example, server 104 uses the private key in the key pair to encrypt the first latest module snapshot, obtaining an encrypted first latest module snapshot. This encrypted first latest module snapshot is then sent to client 102 via the server interface. Client 102 decrypts the encrypted first latest module snapshot using the public key in the pre-stored key pair, obtaining a second latest module snapshot. By comparing the first and second latest module snapshots, the authenticity of the second latest module snapshot is verified. If the second latest module snapshot passes the authenticity verification, a hash calculation is performed on it, and the hash value of the second latest module snapshot is compared with the hash value of the first latest module snapshot to verify its integrity. Multiple hash checks and digital signature verifications are performed during the download and loading of module snapshots to ensure the integrity and source credibility of the module snapshots.
[0082] In one embodiment, the snapshots of each module corresponding to the target application are updated based on a pre-built module dependency graph and the latest module snapshot, including: updating the target module snapshot corresponding to each module snapshot using the latest module snapshot; determining the associated modules that have a dependency relationship with the target module from the module dependency graph based on the target module corresponding to the target module snapshot; and updating the version information of the module snapshots of the associated modules according to the version information of the target module snapshot.
[0083] Optionally, client 102 uses the latest module snapshot to update the corresponding target module snapshot in each module snapshot, and based on the target module corresponding to the target module snapshot, queries the module dependency graph to find the related modules that have dependencies on the target module. Finally, according to the version information of the target module snapshot, the version information of the module snapshots of the related modules is updated accordingly. By using the module dependency graph, the dependent modules are automatically detected and updated when updating a module, ensuring version consistency between modules and avoiding application crashes due to version conflicts.
[0084] In one embodiment, the method further includes: if the latest module snapshot passes the validity check, updating the corresponding module snapshot in the cache directory using the latest module snapshot; if the latest module snapshot fails the validity check, returning the pre-packaged module snapshots corresponding to the target application from the original resource directory according to the application identifier information of the target application.
[0085] For example, if the latest module snapshot passes the validity check, the client uses the latest module snapshot to update the corresponding module snapshot in the cache directory. If the latest module snapshot fails the validity check, it returns pre-packaged module snapshots corresponding to the target application from the original resource directory according to the application identifier information of the target application. The downloaded latest module snapshot is cached in the local directory Y, reducing duplicate downloads and improving resource utilization. In the event of an update failure, it automatically reverts to the pre-packaged module snapshot, ensuring stable application operation and avoiding application crashes due to update failures.
[0086] In one exemplary embodiment, such as Figure 3 As shown, an interactive method for application updates is provided, wherein:
[0087] mk-snapshot: A tool for creating snapshot files of the V8 engine to speed up application startup time and improve performance.
[0088] Module snapshot: A snapshot file of an application module that needs to be dynamically updated, compiled using the mk-snapshot tool.
[0089] Pre-compiled snapshots: V8 engine snapshot files that are pre-compiled and optimized using specific algorithms during the application packaging stage.
[0090] Incremental snapshot: A snapshot file that only contains the changed parts of the module.
[0091] Snapshot dependency graph: A directed acyclic graph (DAG) structure that describes the dependencies between module snapshots.
[0092] I. Main Process Steps:
[0093] 1. Start the client.
[0094] 2. Check if snapshots of each module exist in the local directory Y.
[0095] 3. If it exists, load the corresponding module snapshot; otherwise, load the pre-packaged module snapshot from the local directory X.
[0096] 4. Obtain the latest information on snapshots of each module.
[0097] 5. If a new version is available, download the latest module snapshot and cache it in the local directory.
[0098] 6. Dependency injection of snapshots of each module.
[0099] Use Case: This technical solution is suitable for Electron applications that require frequent updates to snapshots of specific modules. The main devices involved include both client and server sides.
[0100] II. A preferred implementation method:
[0101] 1. Start the client: The user starts the Electron client.
[0102] 2. Check local directory Y: The client checks whether snapshots of each module exist in the local directory Y.
[0103] 3. Load module snapshot:
[0104] If a module snapshot exists in the local directory Y, load it directly.
[0105] If it does not exist, load a pre-packaged module snapshot from the local directory X.
[0106] 4. Obtain the latest module snapshot information: The client obtains the latest snapshot information of each module through the server interface.
[0107] 5. Download and cache the latest module snapshot:
[0108] If the server-side API returns a new version, download the latest module snapshot.
[0109] A hash check is performed during download to ensure file integrity and security.
[0110] Cache the downloaded module snapshot to the local directory Y.
[0111] 6. Snapshot of Dependency Injection Module: Snapshot of each module in the client-side dependency injection module.
[0112] 7. Asynchronous Update Check: After the client starts, it asynchronously checks the snapshot version information of each module on the server and downloads and updates the module snapshots in the background.
[0113] 8. Modular incremental update mechanism:
[0114] Module division: Divide the Electron application into core modules, functional modules, UI modules, etc., and package each module independently into a snapshot file.
[0115] Update process: After the user starts the application, the client dynamically loads the required module snapshots based on the user's actions and checks the module version information. If a new version exists, the client downloads and updates the corresponding module snapshot.
[0116] Dependency Management: The client maintains a dependency graph of modules and automatically detects and updates its dependent modules when a module is updated, ensuring version consistency between modules.
[0117] 9. Offline updates and resume interrupted downloads:
[0118] Offline update package generation: The server generates an offline update package based on the user's device information and pushes it to the user's device.
[0119] Resume download from where you left off: The client records the download progress during the update process, and if the network is interrupted, it will continue downloading the update package from the point of interruption.
[0120] 10. Module snapshot version management:
[0121] Version numbering mechanism: A unique version number is assigned to each module snapshot, and version change logs are recorded.
[0122] Gray release: Pushing new version module snapshots to users in batches, collecting user feedback and fixing issues.
[0123] A / B testing: Run snapshots of different versions of the module simultaneously to collect user behavior data and evaluate the performance of different versions.
[0124] 11. Multiple security checks:
[0125] Multiple hash verification: Multiple hash verification is performed when downloading and loading module snapshots to ensure the integrity of the module snapshots.
[0126] Digital signature verification: Digital signature verification is performed on module snapshots to ensure the credibility of the module snapshot source.
[0127] 12. Combination of hot and cold updates:
[0128] Cold update of core functional modules: Cold update is used for core functional modules to ensure the security and stability of the update process.
[0129] Hot update of non-core functional modules: Hot update is used for non-core functional modules to improve user experience.
[0130] III. Expanding Technical Solutions:
[0131] Based on a preferred implementation method, additional security checks and fault tolerance mechanisms are added:
[0132] 1. Multiple security checks: When downloading and caching module snapshots, multiple hash checks and signature verifications are performed to ensure the integrity of the files and the trustworthiness of their source.
[0133] 2. High fault-tolerant update mechanism: If the download or verification fails during the update process, it will automatically roll back to the pre-packaged module snapshot to ensure the stable operation of the application.
[0134] Compared with the prior art, this application has the following technical advantages:
[0135] 1. Efficient update mechanism: By checking and downloading the latest module snapshots, dynamic updates are achieved, avoiding full updates and improving update efficiency.
[0136] 2. Caching mechanism: The latest downloaded module snapshot is cached in the local directory Y to reduce duplicate downloads and improve resource utilization.
[0137] 3. Seamless Updates: Updates are performed asynchronously in the background, ensuring that the update process is imperceptible to the user, reducing the impact on client startup speed, and improving user experience.
[0138] 4. Security verification mechanism: Hash verification and signature verification are performed during download to ensure file integrity and security and prevent malicious tampering.
[0139] 5. Prevent source code leakage: By using snapshots, the source code is compiled into binary format to prevent leakage and protect intellectual property rights.
[0140] 6. Startup speed optimization: By using a snapshot mechanism, the compilation step during client startup is eliminated, significantly speeding up startup and improving user experience.
[0141] 7. High fault tolerance: In the event of an update failure, it automatically rolls back to a pre-packaged module snapshot to ensure stable application operation and avoid application crashes caused by update failures.
[0142] 8. Pre-packaging mechanism: Pre-package module snapshots into the client to improve system reliability and startup speed, and reduce dependence on the network.
[0143] 9. Modular Incremental Update Mechanism: The Electron application is further subdivided into smaller functional modules, each of which is packaged independently into a snapshot file, enabling on-demand and incremental updates, effectively reducing the size of the update package and increasing the update frequency.
[0144] 10. Module Dependency Management: Establish a module dependency graph, automatically detect and update its dependent modules when updating a module, ensure version consistency between modules, and avoid application crashes caused by version conflicts.
[0145] 11. Offline Updates and Resume Downloads: Update packages are pre-downloaded and cached locally, allowing users to continue updating even in poor network conditions, thus improving the success rate of updates. During the update process, even if the network is interrupted, the update package can be resumed from the point of interruption, avoiding repeated downloads and improving update efficiency.
[0146] 12. Module Snapshot Version Management: Assign a unique version number to each module snapshot and record version change logs to facilitate version tracking and rollback; push new version module snapshots to users in batches, collect user feedback and fix issues to reduce the risk of new version releases; run different versions of module snapshots simultaneously to collect user behavior data, evaluate the performance of different versions, and provide data support for version iteration.
[0147] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0148] Based on the same inventive concept, this application also provides an application update apparatus for implementing the application update method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more application update apparatus embodiments provided below can be found in the limitations of the application update method described above, and will not be repeated here.
[0149] In one exemplary embodiment, such as Figure 4 As shown, an application update apparatus is provided, including: an application determination module 401, a snapshot loading module 402, a snapshot verification module 403, and a snapshot update module 404, wherein:
[0150] The application determination module 401 is used to determine the target application to be activated by the user based on the user-initiated startup command.
[0151] The snapshot loading module 402 is used to load snapshots of each module corresponding to the target application from the local directory of the client according to the application identification information of the target application.
[0152] The snapshot verification module 403 is used to obtain the latest module snapshot through the server interface and to verify the validity of the latest module snapshot;
[0153] The snapshot update module 404 is used to update the snapshots of each module corresponding to the target application based on the pre-built module dependency graph and the latest module snapshot, provided that the latest module snapshot has passed the validity verification.
[0154] In one embodiment, the local directory includes a cache directory and an original resource directory; the snapshot loading module 402 is further configured to, if the cache directory contains snapshots of each module corresponding to the target application, load snapshots of each module corresponding to the target application from the cache directory according to the application identifier information of the target application; if the cache directory does not contain snapshots of each module corresponding to the target application, load pre-packaged snapshots of each module corresponding to the target application from the original resource directory according to the application identifier information of the target application.
[0155] In one embodiment, the application update device is further configured to divide the client's application into a core module, a functional module, and a UI module; package the core module, functional module, and UI module respectively to obtain snapshots of each module corresponding to the application; and construct an original resource directory based on the snapshots of each module corresponding to each application.
[0156] In an exemplary embodiment, the snapshot verification module 403 is further configured to: obtain a first latest module snapshot encrypted with the private key in the key pair via a server interface; decrypt the encrypted first latest module snapshot according to the public key in the pre-stored key pair to obtain a second latest module snapshot; verify the authenticity of the second latest module snapshot based on the first and second latest module snapshots; perform a hash calculation on the second latest module snapshot if the authenticity verification is passed; and perform an integrity verification of the second latest module snapshot based on the hash value corresponding to the second latest module snapshot and the hash value corresponding to the first latest module snapshot.
[0157] In one embodiment, the snapshot update module 404 is further configured to use the latest module snapshot to update the target module snapshot corresponding to each module snapshot; based on the target module corresponding to the target module snapshot, determine the associated modules that have a dependency relationship with the target module from the module dependency graph; and update the version information of the module snapshot of the associated modules according to the version information of the target module snapshot.
[0158] In one embodiment, the application update device is further configured to update the corresponding module snapshot in the cache directory using the latest module snapshot if the latest module snapshot passes the validity check; and to return, according to the application identifier information of the target application, load the pre-packaged module snapshots corresponding to the target application from the original resource directory if the latest module snapshot fails the validity check.
[0159] Each module in the aforementioned application update device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0160] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements an application update method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0161] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0162] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the application update method of the above embodiment.
[0163] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the application update method of the above embodiment.
[0164] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the application update method of the above embodiments.
[0165] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0166] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0167] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0168] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. An application update method characterized by comprising: Applied to a client, the method comprises: According to the user initiated start instruction, determine the target application to be enabled by the user; According to the application identification information of the target application, load the corresponding module snapshots of the target application from the local directory of the client; Obtain the latest module snapshot through the server interface, and perform legality verification on the latest module snapshot; In the case where the latest module snapshot passes the legality verification, update the corresponding module snapshots of the target application according to the pre-constructed module dependency graph and the latest module snapshot.
2. The method of claim 1, wherein, The local directory includes a cache directory and an original resource directory; according to the application identification information of the target application, the corresponding module snapshots of the target application are loaded from the local directory of the client, which comprises: In the case where the cache directory has cached the corresponding module snapshots of the target application, the corresponding module snapshots of the target application are loaded from the cache directory according to the application identification information of the target application; In the case where the cache directory does not cache the corresponding module snapshots of the target application, the pre-packaged corresponding module snapshots of the target application are loaded from the original resource directory according to the application identification information of the target application.
3. The method of claim 2, wherein, The original resource directory is obtained by the following steps: Divide the application of the client into core modules, function modules and UI modules; Packaging the core modules, function modules and UI modules respectively to obtain the corresponding module snapshots of the application; According to the corresponding module snapshots of each application, the original resource directory is constructed.
4. The method of claim 1, wherein, Obtaining the latest module snapshot through the server interface, and performing legality verification on the latest module snapshot, which comprises: Obtain the first latest module snapshot encrypted by the private key of the key pair through the server interface; According to the pre-stored public key of the key pair, the encrypted first latest module snapshot is decrypted to obtain the second latest module snapshot; According to the first latest module snapshot and the second latest module snapshot, the authenticity of the second latest module snapshot is verified; In the case of passing the authenticity verification, the second latest module snapshot is calculated by hash; Based on the hash value corresponding to the second latest module snapshot and the hash value corresponding to the first latest module snapshot, the integrity of the second latest module snapshot is verified.
5. The method of claim 1, wherein, According to the pre-constructed module dependency graph and the latest module snapshot, the corresponding module snapshots of the target application are updated, which comprises: Update the corresponding target module snapshot in the module snapshot by using the latest module snapshot; Based on the target module corresponding to the target module snapshot, determine the associated modules having a dependency relationship with the target module from the module dependency graph; According to the version information of the target module snapshot, update the version information of the module snapshot of the associated module.
6. The method of claim 2, wherein, The method further comprises: In the case where the latest module snapshot passes the legality verification, update the corresponding module snapshot in the cache directory by using the latest module snapshot; In a case where the latest module snapshot fails the legality check, each module snapshot corresponding to the target application is loaded from the original resource directory according to application identification information of the target application.
7. An application update apparatus characterized by comprising: The device is applied to a client and comprises: An application determination module is configured to determine a target application to be started by a user according to a start instruction initiated by the user; A snapshot loading module is configured to load each module snapshot corresponding to the target application from a local directory of the client according to application identification information of the target application; A snapshot checking module is configured to acquire a latest module snapshot through a server interface and perform a legality check on the latest module snapshot; A snapshot updating module is configured to update each module snapshot corresponding to the target application according to a pre-constructed module dependency graph and the latest module snapshot in a case where the latest module snapshot passes the legality check. 8.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-7. The processor executes the computer program to implement the steps of the method in any one of claims 1 to 6.
9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 6.