Application upgrading method and device, electronic equipment, storage medium and program product

By dividing the application into multiple business function modules and using the domain name mechanism to isolate resources, the problem of extended upgrade time caused by calculating and comparing file hash values ​​in the existing differential upgrade methods is solved, and efficient application upgrades and hot updates are achieved.

CN120162072APending Publication Date: 2025-06-17BEIJING CENTURY TAL EDUCATION TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510378128.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-27
Publication Date
2025-06-17

AI Technical Summary

Technical Problem

Existing differential upgrade methods introduce additional upgrade time costs when calculating and comparing file hash values, especially when the software size and file number increase, significantly extending the upgrade time.

Method used

By dividing the application into multiple business function modules and using the domain name mechanism to physically isolate the business resources of each business function module, and only upgrade resources are replaced for the target business function modules that need to be upgraded, avoiding the cumbersome file comparison process.

Benefits of technology

It simplifies the upgrade process, reduces the time cost of upgrades, realizes hot updates of business function modules during application operation, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120162072A_ABST
    Figure CN120162072A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and particularly provides an application upgrading method and device, electronic equipment, a storage medium and a program product. The method comprises the following steps: dividing an application program into at least two service function modules based on a service function which can be realized by the application program; for each service function module, obtaining a domain name for accessing the service function module; when an upgrading event for the application program is detected, determining a target service function module needing to be upgraded from divided service function modules of the application program, and obtaining upgrading resources corresponding to the target service function module; and based on the resource access path corresponding to the target service function module, updating the service resources stored in the resource access path corresponding to the target service function module by using the upgrade resources. Therefore, the service resource is updated by taking the service function module as the minimum upgrading unit, a tedious file comparison process is not needed, and the time consumed by upgrading is reduced.
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, and in particular, to a method, apparatus, electronic device, storage medium, and program product for application upgrade. Background Art

[0002] In the field of software development, the client is usually upgraded by differential upgrade (also known as incremental upgrade). Differential upgrade aims to reduce the bandwidth and time required for updates by only transmitting and installing the different parts between the old and new versions.

[0003] In the related art, during differential upgrade, it is usually compared whether there are differences in each file between the old and new software packages to generate an incremental update package. This process usually involves calculating and comparing the hash values of each file to determine which files need to be updated.

[0004] However, in this way, calculating and comparing the hash values of files will introduce additional upgrade duration costs. As the software scale increases and the number of files increases, this process may significantly extend the upgrade time. Summary of the Invention

[0005] To solve the above technical problems, embodiments of the present disclosure provide a method, apparatus, electronic device, storage medium, and program product for application upgrade.

[0006] On the one hand, embodiments of the present disclosure provide a method for application upgrade, including:

[0007] Dividing an application program into at least two business function modules based on the business functions that the application program can implement;

[0008] For each business function module, obtaining a domain name for accessing the business function module; the domain name is bound to a resource access path of business resources required by the business function module; different business function modules are bound to different domain names; different domain names are bound to different resource access paths; the business resources required by different business function modules are stored in different storage spaces;

[0009] When detecting an upgrade event for the application program, determining a target business function module to be upgraded from the divided business function modules of the application program, and obtaining upgrade resources corresponding to the target business function module; the upgrade resources are business resources corresponding to the target version that the target business function module needs to upgrade;

[0010] Based on the resource access path corresponding to the target business function module, using the upgrade resources to update the business resources stored under the resource access path corresponding to the target business function module, so as to upgrade the target business function module using the upgrade resources.

[0011] In one implementation, before updating the service resources stored under the resource access path corresponding to the target service function module by using the upgrade resources, the method further includes:

[0012] If it is detected that the service function module is currently in an idle state where it is not being accessed, then at least one of the following is adopted:

[0013] Set the service function module to a prohibited access state to prohibit the service function module from being accessed;

[0014] Set the specified domain name range as the current operable range of the application to restrict the application from running within the specified domain name range; the specified domain name range does not include the domain name corresponding to the service function module.

[0015] In one implementation, before updating the service resources stored under the resource access path corresponding to the target service function module by using the upgrade resources, the method further includes:

[0016] If it is detected that the service function module is currently in a non-idle state where it is being accessed, then prohibit updating the service resources until it is detected that the service function module is in an idle state.

[0017] In one implementation, after updating the service resources stored under the resource access path corresponding to the target service function module by using the upgrade resources, the method further includes:

[0018] If the service function module is currently set to the prohibited access state, then switch the prohibited access state to the allowed access state;

[0019] If the current operable range of the application is the specified domain name range, then adjust the specified domain name range to obtain an adjusted domain name range; the adjusted domain name range includes the domain name corresponding to the service function module.

[0020] In one implementation, determining the target service function module that needs to be upgraded from the service function modules into which the application is divided, and obtaining the upgrade resources corresponding to the target service function module, includes:

[0021] For each service function module, the following steps are executed:

[0022] If the current version identifier of the service function module is different from the target version identifier, then determine the service function module as the target service function module that needs to be upgraded;

[0023] Download the upgrade resources corresponding to the target version identifier.

[0024] In one implementation, based on the resource access path corresponding to the target service function module, updating the service resources stored under the resource access path corresponding to the target service function module by using the upgrade resources, includes:

[0025] Replace the service resources stored under the resource access path corresponding to the target service function module with upgraded resources.

[0026] On the one hand, an apparatus for application upgrade provided in an embodiment of the present disclosure includes:

[0027] A partitioning unit, configured to partition an application program into at least two service function modules based on service functions achievable by the application program;

[0028] An obtaining unit, configured to obtain, for each service function module, a domain name for accessing the service function module; the domain name is bound to a resource access path of service resources required by the service function module; different service function modules are bound to different domain names; different domain names are bound to different resource access paths; service resources required by different service function modules are stored in different storage spaces;

[0029] A detecting unit, configured to, when detecting an upgrade event for the application program, determine a target service function module to be upgraded from the service function modules into which the application program is partitioned, and obtain upgraded resources corresponding to the target service function module; the upgraded resources are service resources corresponding to a target version to which the target service function module needs to be upgraded;

[0030] An upgrading unit, configured to update, based on the resource access path corresponding to the target service function module, the service resources stored under the resource access path corresponding to the target service function module by using the upgraded resources, so as to upgrade the target service function module by using the upgraded resources.

[0031] In one implementation, the upgrading unit is further configured to:

[0032] If it is detected that the service function module is currently in an idle state where it is not being accessed, then at least one of the following is adopted:

[0033] Set the service function module to a prohibited access state to prohibit the service function module from being accessed;

[0034] Set a specified domain name range as the current operable range of the application program to limit the application program to run within the specified domain name range; the specified domain name range does not include the domain name corresponding to the service function module.

[0035] In one implementation, the upgrading unit is further configured to:

[0036] If it is detected that the service function module is currently in a non-idle state where it is being accessed, then prohibit updating the service resources until it is detected that the service function module is in an idle state.

[0037] In one implementation, the upgrading unit is further configured to:

[0038] If the business function module is currently set to the prohibited access state, switch the prohibited access state to the permitted access state;

[0039] If the current runnable range of the application is the specified domain name range, adjust the specified domain name range to obtain the adjusted domain name range; the adjusted domain name range includes the domain name corresponding to the business function module.

[0040] In one implementation, the detection unit is used to:

[0041] For each business function module, perform the following steps:

[0042] If the current version identifier of the business function module is different from the target version identifier, determine that the business function module is the target business function module to be upgraded;

[0043] Download the upgrade resources corresponding to the target version identifier.

[0044] In one implementation, the upgrade unit is used to: replace the business resources stored under the resource access path corresponding to the target business function module with the upgrade resources.

[0045] On the one hand, an electronic device is provided in an embodiment of the present disclosure, including:

[0046] A processor; and

[0047] A memory storing computer instructions for causing the processor to execute the steps of the method provided in any of the various alternative implementations of the above application upgrade.

[0048] On the one hand, a computer-readable storage medium is provided in an embodiment of the present disclosure, storing computer instructions for causing a computer to execute the steps of the method provided in any of the various alternative implementations of the above application upgrade.

[0049] On the one hand, a computer program product is provided in an embodiment of the present disclosure, including computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in the processor of the electronic device, the processor in the electronic device executes the steps of the method provided in any of the various alternative implementations of the above application upgrade.

[0050] The method for application upgrade in the embodiments of the present disclosure includes dividing an application program into at least two business function modules based on the business functions achievable by the application program; for each business function module, obtaining a domain name for accessing the business function module; the domain name is bound with a resource access path of the business resources required by the business function module; different business function modules are bound with different domain names; different domain names are bound with different resource access paths; the business resources required by different business function modules are stored in different storage spaces; when an upgrade event for the application program is detected, determining a target business function module to be upgraded from the business function modules into which the application program is divided, and obtaining upgrade resources corresponding to the target business function module; the upgrade resources are the business resources corresponding to the target version that the target business function module needs to upgrade; based on the resource access path corresponding to the target business function module, using the upgrade resources to update the business resources stored under the resource access path corresponding to the target business function module, so as to upgrade the target business function module with the upgrade resources. In this way, the business resources are updated with the business function module as the smallest upgrade unit, without a cumbersome file comparison process, reducing the time consumed for the upgrade. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 is a flowchart of a method for application upgrade in the embodiments of the present disclosure.

[0052] Figure 2 is an example diagram of application upgrade in the embodiments of the present disclosure.

[0053] Figure 3 is an example diagram of an application upgrade process under a related technology.

[0054] Figure 4 is an example diagram of an application upgrade process under the embodiments of the present application.

[0055] Figure 5 is a structural block diagram of an apparatus for application upgrade in the embodiments of the present disclosure.

[0056] Figure 6 is a schematic structural diagram of an electronic device in the embodiments of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0057] The technical solutions of the present disclosure will be clearly and completely described below with reference to the accompanying drawings. Apparently, the described embodiments are some but not all of the embodiments of the present disclosure. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments of the present disclosure fall within the scope of protection of the present disclosure. In addition, the technical features involved in different embodiments of the present disclosure described below can be combined with each other as long as they do not conflict with each other.

[0058] In the field of software development, differential upgrade is a common software update strategy aimed at reducing the bandwidth and time required for updates by transmitting and installing only the different parts between the old and new versions. Differential upgrade usually includes three stages: difference comparison, incremental download, and cold update.

[0059] The so-called difference comparison means: By using a dedicated downloader or tool, compare the file differences between the old and new software packages to generate an incremental update package. This process usually involves calculating and comparing the hash values of files to determine which files need to be updated.

[0060] The so-called incremental download means: Only download the different parts between the old and new versions, rather than the entire new version of the software package. The so-called cold update means that during the update process, it is usually necessary to close the running application, or restart the application after the update is completed, to ensure that the updated files can be correctly loaded and take effect.

[0061] However, in the difference comparison stage, especially in scenarios with a large number of hash files, calculating and comparing the hash values of files will introduce additional upgrade time costs. As the software scale increases and the number of files increases, this process may significantly extend the upgrade time and affect the user experience.

[0062] In addition, the cold update solution requires closing the application during the upgrade process, or restarting the application after the upgrade is completed. This not only causes the user to be unable to use the software during the upgrade, but also may split the software execution cycles before and after the upgrade, increasing the difficulty of problem tracing and troubleshooting. In addition, frequent restarts will also have a negative impact on the user experience, especially in application scenarios that need to run for a long time.

[0063] Based on the defects of the above related technologies, the embodiments of the present disclosure provide a method, device, electronic device, storage medium, and program product for application upgrade, aiming to reduce the time cost of upgrade.

[0064] The embodiments of the present disclosure provide a method for application upgrade. This method can be applied to an electronic device. The present disclosure does not limit the type of the electronic device, and it can be any device type suitable for implementation, such as a terminal device and a server, etc. The present disclosure will not elaborate on this.

[0065] Refer to Figure 1 As shown in the flowchart of a method for application upgrade in the embodiments of the present disclosure, the following will describe this method in combination with Figure 1 The specific implementation process of this method is as follows:

[0066] Step 101: Based on the business functions that the application can implement, divide the application into at least two business function modules.

[0067] Among them, the upgraded application program in the embodiments of the present application has the characteristics of HyperText Markup Language 5 (HTML5), and subsequent upgrades are implemented based on the HTML5 characteristics in the application program. The application program can be a client or a server. For example, it can be a browser, a desktop application, or a mobile application. For example, the application program can be a browser.

[0068] Among them, the business function module can be an independent unit in the application program that implements specific business functions. Each module is responsible for completing one or more related business functions and interacts with other modules through clearly defined interfaces.

[0069] For example, an e-commerce application program can be divided into the following business function modules: a user management module, a product management module, and an order management module.

[0070] Among them, the user management module: is responsible for functions such as user registration, login, and permission management. The product management module: is responsible for functions such as product display, search, and classification. The order management module: is responsible for functions such as order creation, payment, and logistics tracking.

[0071] In practical applications, the business function modules can also be divided according to business attributes and other methods, which are not limited here.

[0072] In this way, the application program can be divided into multiple sub-modules, that is, business function modules, for subsequent upgrades.

[0073] Step 102: For each business function module, obtain the domain name used to access the business function module; the domain name is bound to the resource access path of the business resources required by the business function module; different business function modules are bound to different domain names; different domain names are bound to different resource access paths; the business resources required by different business function modules are stored in different storage spaces.

[0074] Furthermore, before executing step 102, the application program can also be initialized first, and the following steps can be specifically adopted:

[0075] S1021: Bind different domain names to the respective business function modules of the application program.

[0076] Among them, the domain name bound to the business function module is used to access the business function module.

[0077] For example, an e-commerce application program includes the following three modules: a product display module, a shopping cart module, and a payment module, and the domain names bound to them are in sequence: product.example.com, cart.example.com, and payment.example.com.

[0078] S1022: Register the domain names respectively bound to each business function module to different resource access paths locally.

[0079] For example, an e-commerce application respectively includes: a product display module, a shopping cart module, and a payment module, and the corresponding domain names are in sequence: product.example.com, cart.example.com, and payment.example.com. The resource access paths respectively mapped by the above domain names are in sequence: / app / resources / product / , / app / resources / cart / , and / app / resources / payment / .

[0080] Among them, different resource storage spaces are respectively allocated for different business function modules to store the business resources of the corresponding business function modules through the respective resource storage spaces. Obtain the resource access paths of the resource storage spaces respectively corresponding to each business function module, and map the domain name bound to each business function module to the resource access path of this business function module. The storage location of business resources can be located through the resource access path. Since different resource storage spaces are independent of each other, different resource access paths are isolated from each other.

[0081] Among them, business resources refer to the set of files or data required for the operation of business function modules, including code files, configuration files, static resource files, data files, and dependency files, etc., which are used to implement business functions and support the normal operation of modules.

[0082] For example, a code file is a file for implementing business logic, such as a JavaScript script (JavaScript, JS) file. A configuration file is a file for configuring the behavior of a business function module. Static resource files can be HyperText Markup Language (HTML) files, Cascading Style Sheets (CSS) files, image resources, and video resources, etc. Data files can be database files, cache files, and log files, etc. used by business function modules. Dependency files can be library or framework files on which business function modules depend, such as third-party libraries, plugins, components, etc.

[0083] In this way, different business function modules can be bound to different domain names, and a mapping relationship between different domain names and different resource access paths locally can be established to ensure the isolation of resource access.

[0084] S1023: Store the service resources of each service function module under the resource access path corresponding to the service function module.

[0085] For example, for the above e-commerce application, the product display resources of the product display module can be accessed through product.example.com, and the shopping cart resources of the shopping cart module can also be accessed through cart.example.com.

[0086] In this way, the service resources are stored in the local file system of the application and are accessed and managed through the domain name mechanism.

[0087] Step 103: When an upgrade event for the application is detected, determine the target service function module to be upgraded from the service function modules into which the application is divided, and obtain the upgrade resources corresponding to the target service function module; the upgrade resources are the service resources corresponding to the target version to which the target service function module needs to be upgraded.

[0088] In one implementation, when executing Step 103, the following steps can be executed for each service function module respectively:

[0089] If the current version identifier of the service function module is different from the target version identifier, determine that the service function module is the target service function module to be upgraded; download the upgrade resources corresponding to the target version identifier.

[0090] Among them, the version identifier is used to identify the version of the application, including both the current version identifier and the target version identifier. The version identifier can adopt at least one of the following items: version number, version timestamp, version size, and version hash value. Optionally, the upgrade resources can be downloaded in the form of a resource package.

[0091] Step 104: Based on the resource access path corresponding to the target service function module, use the upgrade resources to update the service resources stored under the resource access path corresponding to the target service function module, so as to upgrade the target service function module with the upgrade resources.

[0092] In one implementation, replace the service resources stored under the resource access path corresponding to the target service function module with the upgrade resources.

[0093] For example, an e-commerce application includes the following three modules: a product display module, a shopping cart module, and a payment module. The domain names bound to them are: product.example.com, cart.example.com, and payment.example.com, respectively. The resource access paths mapped by the above domain names are: / app / resources / product / , / app / resources / cart / , and / app / resources / payment / , respectively.

[0094] The current version identifier of the product display module is Product Display Version 1.0, and the target version identifier is Product Display Version 2.0. Therefore, if the e-commerce application determines that the product display module is the target business function module to be upgraded, it downloads the upgrade resources corresponding to Product Display Version 2.0. Then, the e-commerce application replaces the upgrade resources into the / app / resources / product / path. After the upgrade is completed, the e-commerce application can immediately switch to the new version of the resources. During the entire upgrade process, the shopping cart module and the payment module in the e-commerce application are not affected and can both run and be accessed normally.

[0095] The following Figure 2 is an example to illustrate the application upgrade. Refer to Figure 2 shown in the figure, which is an example diagram of an application upgrade. Figure 2 In the figure, the application includes two business function modules, namely Business A and Business B.

[0096] Among them, the domain name bound to Business A is: scheme: / / domain_A, the resource access path is: / app / resources / A, the access page is scheme: / / domain_A / index.html, the business resource is resource_A1, and the current version identifier is version_A_1.1. When the application detects the existence of the target version identifier version_A_1.3 corresponding to Business A, it can download resource_A2 (i.e., the upgrade resources) from the server and replace the resource_A1 (i.e., the business resource) stored under / app / resources / A (i.e., the resource access path of Business A) mapped by scheme: / / domain_A (i.e., the domain name bound to Business A) with resource_A2.

[0097] Among them, the domain name bound to Service B is: scheme: / / domain_B, the resource access path is: / app / resources / B, the access page is scheme: / / domain_B / index.html, the service resource is resource_B1, and the current version identifier is version_B_2.1. If the application detects the existence of version_B_2.2 (target version identifier) corresponding to Service B, it can download resource_B2 (i.e., the upgraded resource) identified by version_B_2.2 from the server, and replace resource_B1 (i.e., the service resource) stored under / app / resources / B (i.e., the resource access path of Service B) mapped by scheme: / / domain_B (i.e., the domain name bound to Service B) with resource_B2.

[0098] In this way, the service resources of a single service function module can be used as the smallest upgrade and replacement unit, without the need to perform further comparison and verification on the old and new versions of sub-resources within the service, simplifying the cumbersome operation of file comparison and reducing the time consumed by file comparison.

[0099] Furthermore, only some of the service resources stored under this resource access path can be replaced with the corresponding resources in the upgraded resources.

[0100] For example, the service resources include specific invariant basic resources, which will not change during the continuous upgrade of the application. Therefore, only other resources outside the basic resources can be replaced.

[0101] Furthermore, in order to upgrade the service function module during the operation of the application without having to exit the application due to the upgrade or restart the application after the upgrade, the following steps can also be adopted before executing step 104:

[0102] If it is detected that the service function module is currently in an idle state where it is not being accessed, at least one of the following methods can be adopted:

[0103] Method 1: Set the service function module to a prohibited access state to prevent the service function module from being accessed.

[0104] Method 2: Set the specified domain name range as the current operable range of the application to restrict the application from running within the specified domain name range; the specified domain name range does not include the domain name corresponding to the service function module.

[0105] Among them, access can include the service function module being operated or referenced. It should be noted that whether the service function module is accessed specifically refers to whether the service resources corresponding to the service function module are accessed.

[0106] Further, if it is detected that the business function module is currently in a non-idle state being accessed, the following steps may also be adopted: prohibit updating the business resources until it is detected that the business function module is in an idle state.

[0107] In this way, only when the business function module is in an idle state and the current business resources of the business function module are in a state where they are not being operated on or referenced at all, will the resource replacement operation, that is, the upgrade operation, be triggered. Thus, during the execution of the upgrade operation, the upgrade resources can be normally replaced without having to exit the application to clear the file occupation state.

[0108] Further, after executing step 104, the following steps may also be adopted:

[0109] If the business function module is currently set to the prohibited access state, switch the prohibited access state to the permitted access state;

[0110] If the current runnable range of the application is the specified domain name range, adjust the specified domain name range to obtain the adjusted domain name range; the adjusted domain name range includes the domain name corresponding to the business function module.

[0111] In one implementation, when updating the business resources, the following steps may be adopted:

[0112] S1041: Detect whether the business function module is currently in an idle state where it is not being accessed. If so, execute S1042; otherwise, execute S1047.

[0113] S1042: Set the business function module to the prohibited access state.

[0114] S1043: Set the specified domain name range as the current runnable range of the application.

[0115] S1044: Replace the business resources stored under the resource access path corresponding to the target business function module with the upgrade resources.

[0116] S1045: Switch the prohibited access state to the permitted access state.

[0117] S1046: Adjust the specified domain name range to obtain the adjusted domain name range; the adjusted domain name range includes the domain name corresponding to the business function module.

[0118] S1047: Prohibit updating the business resources and execute S1041.

[0119] In this way, during the running of the application, the target business function module can be upgraded without having to exit the application or restart the application after the upgrade is completed.

[0120] The following combines Figure 3 and Figure 4 to make a comparative description of the related technology and the application upgrade solution in the embodiments of the present application. Refer to Figure 3 As shown, it is an example diagram of an application upgrade process under a related technology. Refer to Figure 4 As shown, it is an example diagram of an application upgrade process under an embodiment of the present application.

[0121] Figure 3 In , after the client is started, all business resources (such as business A resources, business B resources, and business C resources, etc.) are loaded. Then, it can be detected whether the client needs to be upgraded. If so, the client is exited, and the different parts between the old and new versions of the client, that is, the differential data packet, is downloaded, and the upgrade is performed using the different part. And after the upgrade is completed, the client is restarted.

[0122] Figure 4 In , the client contains three business function modules, namely business A, business B, and business C. The domain name bound by business A is: scheme: / / domain_A, the domain name bound by business B is: scheme: / / domain_B, and the domain name bound by business C is: scheme: / / domain_C. The client also contains a basic function module that does not need to be upgraded. Based on a configuration principle similar to that of the business function module, the basic function module is also bound with the domain name scheme: / / base. Among them, the basic function module and each business function module are respectively bound with different domain names and are respectively mapped to different resource access paths to store business resources through mutually isolated storage spaces. The client can jump from the basic function module to the corresponding business function module through the domain names respectively bound by each of business A, business B, and business C.

[0123] After the client is started, it currently only runs within the domain name range corresponding to the basic service, that is, business A, business B, and business C are all in an idle state where they are not accessed. After detecting that the client needs to be upgraded, if it is determined that the target business function module that needs to be upgraded among business A, business B, and business C is business A, then only the upgrade resources of business A can be downloaded, and the client is restricted to only run within the domain name range corresponding to the basic service, and the business resources stored under the resource access path mapped by the domain name bound by business A are replaced with the upgrade resources. Finally, the running range limit of the client is lifted. If an access request for business A is received, then business A responds to the access request. In this way, the upgrade process can be restricted before jumping to business A through the domain name, avoiding file occupation during the upgrade process, thereby realizing the hot update of resource upgrade.

[0124] In the related art, it is necessary to compare the differences between the files in the old and new software packages to generate an incremental update package. This process usually involves calculating and comparing the hash values of the files to determine which files need to be updated. Calculating and comparing the hash values of the files will introduce additional upgrade time costs. As the scale of the software increases and the number of files increases, this process may significantly extend the upgrade time and affect the user experience. In the embodiments of the present application, the business function module is used as the smallest unit for upgrading, and only the version identifiers of the business function modules need to be compared, which simplifies the cumbersome operation of upgrading and greatly reduces the time cost consumed.

[0125] Furthermore, in the related art, the difference part between the old and new versions is downloaded, and each file in the difference part is separately replaced with the corresponding file of the current application to achieve the upgrade. However, for the separate replacement of multiple files, the operation is also relatively cumbersome and will also consume a lot of time. In the embodiments of the present application, the application is divided into multiple business function modules, and the domain name mechanism is adopted to physically isolate the business resources of each business function module. Therefore, the upgrade resources of the target business function module that needs to be upgraded can be directly downloaded, and the current business resources of the target business function module can be directly replaced with the upgrade resources, which simplifies the cumbersome operation of resource replacement and reduces the time cost of resource replacement.

[0126] Further, the related art uses the cold update method for upgrading, that is, it is usually necessary to close the running application or restart the application after the update is completed. However, the cold update solution requires closing the application during the upgrade process or restarting the application after the upgrade is completed. In the embodiments of the present application, the hot update method is used for upgrading. That is, during the running of the application, when the target business function that needs to be upgraded is in an idle state, the upgrade resources are replaced, and during this replacement process, the target business function is prohibited from being accessed. Therefore, during the upgrade of the application, the current business resources of the target business function module will not be occupied, and the application does not need to exit and restart the application, improving the user experience.

[0127] Based on the same inventive concept, an application upgrade device is also provided in the embodiments of the present disclosure. Since the principle of solving problems by the above device and equipment is similar to that of an application upgrade method, the implementation of the above device can refer to the implementation of the method, and the repeated parts will not be described again. The device can be applied to an electronic device. The present disclosure does not limit the type of the electronic device, and it can be any device type suitable for implementation, such as a terminal device and a server, etc. The present disclosure will not elaborate on this. The device embodiment can be implemented by software, or by hardware or a combination of software and hardware. Taking the software implementation as an example, as a logically meaningful device, it is formed by the processor of the electronic device where it is located reading the corresponding computer program instructions in the non-volatile memory into the memory and running them.

[0128] Refer to Figure 5 As shown, it is a structural block diagram of an apparatus for application upgrade in an embodiment of the present disclosure. In some embodiments, the apparatus for application upgrade according to the examples of the present disclosure includes:

[0129] A partitioning unit 501, configured to partition an application program into at least two service function modules based on the service functions achievable by the application program;

[0130] An obtaining unit 502, configured to obtain, for each service function module, a domain name for accessing the service function module; the domain name is bound to a resource access path of service resources required by the service function module; different service function modules are bound to different domain names; different domain names are bound to different resource access paths; the service resources required by different service function modules are stored in different storage spaces;

[0131] A detection unit 503, configured to, when detecting an upgrade event for the application program, determine a target service function module to be upgraded from the service function modules into which the application program is partitioned, and obtain upgrade resources corresponding to the target service function module; the upgrade resources are service resources corresponding to the target version to which the target service function module needs to be upgraded;

[0132] An upgrade unit 504, configured to update the service resources stored under the resource access path corresponding to the target service function module by using the upgrade resources based on the resource access path corresponding to the target service function module, so as to upgrade the target service function module by using the upgrade resources.

[0133] In one embodiment, the upgrade unit 504 is further configured to:

[0134] If it is detected that the service function module is currently in an idle state where it is not being accessed, then at least one of the following items is adopted:

[0135] Set the service function module to a prohibited access state to prohibit the service function module from being accessed;

[0136] Set a specified domain name range as the current operable range of the application program to limit the application program to run within the specified domain name range; the specified domain name range does not include the domain name corresponding to the service function module.

[0137] In one embodiment, the upgrade unit 504 is further configured to:

[0138] If it is detected that the service function module is currently in a non-idle state where it is being accessed, then prohibit updating the service resources until it is detected that the service function module is in an idle state.

[0139] In one embodiment, the upgrade unit 504 is further configured to:

[0140] If the current access status of the business function module is set to prohibited, switch the prohibited access status to allowed access status;

[0141] If the current runnable range of the application is the specified domain name range, adjust the specified domain name range to obtain the adjusted domain name range; the adjusted domain name range includes the domain name corresponding to the business function module.

[0142] In one implementation, the detection unit 503 is used to:

[0143] For each business function module, perform the following steps:

[0144] If the current version identifier of the business function module is different from the target version identifier, determine that the business function module is the target business function module to be upgraded;

[0145] Download the upgrade resources corresponding to the target version identifier.

[0146] In one implementation, the upgrade unit 504 is used to: Replace the business resources stored under the resource access path corresponding to the target business function module with the upgrade resources.

[0147] The application upgrade method in the embodiments of the present disclosure includes dividing the application into at least two business function modules based on the business functions that the application can implement; for each business function module, obtaining the domain name used to access the business function module; the domain name is bound to the resource access path of the business resources required by the business function module; different business function modules are bound to different domain names; different domain names are bound to different resource access paths; the business resources required by different business function modules are stored in different storage spaces; when an upgrade event for the application is detected, determine the target business function module to be upgraded from the business function modules into which the application is divided, and obtain the upgrade resources corresponding to the target business function module; the upgrade resources are the business resources corresponding to the target version to which the target business function module needs to be upgraded; based on the resource access path corresponding to the target business function module, use the upgrade resources to update the business resources stored under the resource access path corresponding to the target business function module, so as to upgrade the target business function module with the upgrade resources. In this way, the business resources are updated with the business function module as the smallest upgrade unit, without the need for a cumbersome file comparison process, reducing the time consumed for the upgrade.

[0148] In the embodiments of the present disclosure, there is also provided an electronic device, including:

[0149] A processor; and

[0150] A memory storing computer instructions for causing the processor to execute the method of any of the above implementations.

[0151] In an embodiment of the present disclosure, a computer-readable storage medium is provided, storing computer instructions for causing a computer to execute the method of any of the above embodiments.

[0152] The embodiment of the present disclosure further provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the method of any of the above embodiments.

[0153] Figure 6 A schematic structural diagram of an electronic device 6000 is shown. Refer to Figure 6 As shown, the electronic device 6000 includes: a processor 6010 and a memory 6020. Optionally, it may further include a power supply 6030, a display unit 6040, and an input unit 6050.

[0154] The processor 6010 is the control center of the electronic device 6000, connecting each component through various interfaces and lines, and executing various functions of the electronic device 6000 by running or executing software programs and / or data stored in the memory 6020, thereby performing overall monitoring of the electronic device 6000.

[0155] In an embodiment of the present disclosure, when the processor 6010 calls the computer program stored in the memory 6020, it executes each step in the above embodiment.

[0156] Optionally, the processor 6010 may include one or more processing units; preferably, the processor 6010 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, applications, etc., and the modem processor mainly processes wireless communication. It can be understood that the above modem processor may not be integrated into the processor 6010. In some embodiments, the processor and the memory can be implemented on a single chip, and in some embodiments, they can also be separately implemented on independent chips.

[0157] The memory 6020 may mainly include a program storage area and a data storage area. Among them, the program storage area may store the operating system, various applications, etc.; the data storage area may store data created according to the use of the electronic device 6000, etc. In addition, the memory 6020 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices, etc.

[0158] The electronic device 6000 further includes a power supply 6030 (such as a battery) for supplying power to each component. The power supply can be logically connected to the processor 6010 through a power management system, so as to manage functions such as charging, discharging, and power consumption through the power management system.

[0159] The display unit 6040 can be used to display information input by the user or information provided to the user, as well as various menus of the electronic device 6000. In the embodiments of the present disclosure, it is mainly used to display the display interfaces of various applications in the electronic device 6000 and objects such as text and pictures displayed in the display interfaces. The display unit 6040 may include a display panel 6041. The display panel 6041 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.

[0160] The input unit 6050 can be used to receive information such as numbers or characters input by the user. The input unit 6050 may include a touch panel 6051 and other input devices 6052. Among them, the touch panel 6051, also known as a touch screen, can collect touch operations of the user on or near it (such as operations of the user using a finger, a stylus, or any suitable object or accessory on or near the touch panel 6051).

[0161] Specifically, the touch panel 6051 can detect the touch operation of the user, detect the signals brought by the touch operation, convert these signals into contact coordinates, send them to the processor 6010, and receive and execute the commands sent by the processor 6010. In addition, the touch panel 6051 can be implemented in multiple types such as resistive, capacitive, infrared, and surface acoustic wave. The other input devices 6052 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, power on / off keys, etc.), a trackball, a mouse, a joystick, etc.

[0162] Of course, the touch panel 6051 can cover the display panel 6041. After the touch panel 6051 detects a touch operation on or near it, it transmits the operation to the processor 6010 to determine the type of touch event. Subsequently, the processor 6010 provides a corresponding visual output on the display panel 6041 according to the type of touch event. Although in Figure 6 the touch panel 6051 and the display panel 6041 are implemented as two independent components to realize the input and output functions of the electronic device 6000, in some embodiments, the touch panel 6051 and the display panel 6041 can be integrated to realize the input and output functions of the electronic device 6000.

[0163] The electronic device 6000 may further include one or more sensors, such as a pressure sensor, a gravity acceleration sensor, a proximity light sensor, etc. Of course, according to the needs in specific applications, the above-mentioned electronic device 6000 may further include other components such as a camera. Since these components are not the key components used in the embodiments of the present disclosure, therefore, in Figure 6 it is not shown and will not be described in detail.

[0164] Those skilled in the art can understand that Figure 6 this is only an example of an electronic device and does not constitute a limitation on the electronic device. It may include more or fewer components than shown in the figure, or combine some components, or different components.

[0165] For the convenience of description, the above parts are divided into various modules (or units) according to their functions and described separately. Of course, when implementing the present disclosure, the functions of the various modules (or units) can be implemented in the same or multiple software or hardware.

Claims

1. A method for application upgrade, characterized in that: The method comprises: Based on the business functions that can be realized by the application, the application is divided into at least two business function modules; For each business function module, a domain name for accessing the business function module is obtained; the domain name is bound to a resource access path of the business resources required by the business function module; different business function modules are bound to different domain names; different domain names are bound to different resource access paths; business resources required by different business function modules are stored in different storage spaces; When an upgrade event for the application is detected, a target business function module that needs to be upgraded is determined from the business function modules into which the application is divided, and an upgrade resource corresponding to the target business function module is obtained; the upgrade resource is a business resource corresponding to the target version that needs to be upgraded for the target business function module; Based on the resource access path corresponding to the target business function module, the business resources stored under the resource access path corresponding to the target business function module are updated using the upgrade resources, so as to upgrade the target business function module using the upgrade resources.

2. The method according to claim 1, characterized in that Before using the upgrade resource to update the service resources stored in the resource access path corresponding to the target service function module, the method further includes: If it is detected that the service function module is currently in an idle state and is not accessed, at least one of the following items is adopted: Setting the business function module to a prohibited access state to prohibit access to the business function module; The specified domain name range is set as the current executable range of the application program to limit the application program to run within the specified domain name range; the specified domain name range does not include the domain name corresponding to the business function module.

3. The method according to claim 2, characterized in that Before using the upgrade resource to update the service resources stored in the resource access path corresponding to the target service function module, the method further includes: If it is detected that the service function module is currently in an accessed non-idle state, updating of the service resource is prohibited until it is detected that the service function module is in an idle state.

4. The method according to claim 2 or 3, characterized in that: After using the upgrade resource to update the service resources stored in the resource access path corresponding to the target service function module, the method further includes: If the business function module is currently set to a prohibited access state, switching the prohibited access state to an allowed access state; If the current executable range of the application is a specified domain name range, the specified domain name range is adjusted to obtain an adjusted domain name range; the adjusted domain name range includes the domain name corresponding to the business function module.

5. The method according to any one of claims 1 to 3, characterized in that: Determining a target business function module that needs to be upgraded from the business function modules into which the application is divided, and obtaining upgrade resources corresponding to the target business function module; The upgrade resource is a business resource corresponding to the target version that the target business function module needs to upgrade, including: For each business function module, perform the following steps: If the current version identifier of the business function module is different from the target version identifier, determining that the business function module is a target business function module that needs to be upgraded; Download the upgrade resource corresponding to the target version identifier.

6. The method according to any one of claims 1 to 3, characterized in that: The updating of the service resources stored in the resource access path corresponding to the target service function module by using the upgrade resource based on the resource access path corresponding to the target service function module includes: The business resources stored under the resource access path corresponding to the target business function module are replaced with the upgraded resources.

7. A device for application upgrade, characterized in that: The device comprises: A division unit, configured to divide the application into at least two business function modules based on business functions that can be realized by the application; An obtaining unit is used to obtain, for each business function module, a domain name used to access the business function module; the domain name is bound to a resource access path of a business resource required by the business function module; different business function modules are bound to different domain names; different domain names are bound to different resource access paths; business resources required by different business function modules are stored in different storage spaces; a detection unit, configured to, when an upgrade event for the application is detected, determine a target business function module that needs to be upgraded from the business function modules into which the application is divided, and obtain an upgrade resource corresponding to the target business function module; the upgrade resource is a business resource corresponding to a target version that needs to be upgraded for the target business function module; An upgrading unit is used to update the business resources stored under the resource access path corresponding to the target business function module using the upgrading resources based on the resource access path corresponding to the target business function module, so as to upgrade the target business function module using the upgrading resources.

8. An electronic device, characterized in that: include: processor; as well as A memory storing computer instructions, wherein the computer instructions are used to enable the processor to execute the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: Computer instructions are stored, and the computer instructions are used to make a computer execute the method according to any one of claims 1 to 6.

10. A computer program product, characterized in that The invention comprises a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code is executed in a processor of an electronic device, the processor in the electronic device performs the method according to any one of claims 1 to 6.

Citation Information

Cited By

  • Automatic OTA upgrading method and system for humanoid robot

    CN121704883A

  • Humanoid robot OTA automatic upgrading method and system

    CN121704883B