An application upgrade maintenance method, device, equipment and medium

By differentiating between business logic and basic function script types in applications for upgrades and maintenance, and managing business logic scripts on a remote server, the problem of user data leakage and experience degradation caused by application vulnerabilities was solved, achieving efficient upgrade management.

CN116301991BActive Publication Date: 2026-04-21BEIJING WISDOM TOOTH TECH CONSULTING CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING WISDOM TOOTH TECH CONSULTING CO LTD
Filing Date
2023-03-21
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

As applications are used for longer periods, the probability of vulnerabilities increases, leading to a higher risk of user data leakage and a decline in user experience. Existing technologies lack efficient upgrade and maintenance methods.

Method used

Based on the upgrade request triggered by the user, distinguish between business logic scripts and basic function scripts, and perform upgrades and maintenance separately. The upgraded business logic scripts are stored on a remote server and the address mapping relationship is cleared. Script calls are managed through hash values, and abnormal scripts are upgraded periodically.

Benefits of technology

It improves the efficiency of application upgrades and maintenance, reduces the probability of unnecessary upgrade operations, reduces execution errors, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116301991B_ABST
    Figure CN116301991B_ABST
Patent Text Reader

Abstract

The application relates to the computer technical field, in particular to an application program upgrading and maintaining method and device, equipment and medium, the method comprises the following steps: when detecting an upgrading request triggered by a user, determining a to-be-upgraded script type based on the upgrading request, the to-be-upgraded script type comprises a business logic script type and a basic function script type; when the to-be-upgraded script type is the business logic script type, obtaining a to-be-upgraded business logic script, upgrading the to-be-upgraded business logic script, obtaining an upgraded business logic script, and uploading the upgraded business logic script to a first storage space again; and when the to-be-upgraded script type is the basic function script type, obtaining a to-be-upgraded basic function script, performing mirror processing on the to-be-upgraded basic function script, and storing the mirror-processed basic function script in a second storage space. The application can upgrade and maintain the application program in time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device and medium for application upgrade and maintenance. Background Technology

[0002] As applications are used for longer periods, the probability of vulnerabilities appearing during operation increases. When vulnerabilities occur, the likelihood of users being attacked increases, leading to the leakage of user data. In addition, as users' demands for applications increase, vulnerabilities may affect the user experience.

[0003] Therefore, there is an urgent need for a method to upgrade and maintain applications so that vulnerabilities that may appear in the applications can be fixed in a timely manner. Summary of the Invention

[0004] In order to upgrade and maintain applications in a timely manner, thereby improving the user experience, this application provides an application upgrade and maintenance method, apparatus, device and medium.

[0005] Firstly, this application provides a method for upgrading and maintaining an application, employing the following technical solution:

[0006] An application upgrade and maintenance method includes:

[0007] When a user-triggered upgrade request is detected, the type of script to be upgraded is determined based on the upgrade request. The type of script to be upgraded includes business logic script type and basic function script type.

[0008] When the type of script to be upgraded is a business logic script, the business logic script to be upgraded is obtained, the business logic script to be upgraded is upgraded to obtain the upgraded business logic script, and the upgraded business logic script is re-uploaded to the first storage space.

[0009] When the type of the script to be upgraded is a basic function script, the basic function script to be upgraded is obtained, the basic function script to be upgraded is mirrored, and the mirrored basic function script is stored in the second storage space.

[0010] By adopting the above technical solution, after determining the type of script to be upgraded based on the upgrade request triggered by the user, the corresponding scripts in the application are then upgraded and maintained according to the upgrade request. Instead of upgrading and maintaining all scripts in the application at the same time when a user-triggered upgrade request is detected, the upgrade request determines the type of script to be upgraded, and then the scripts are upgraded and maintained according to the type of script to be upgraded. This distinguishes the business logic scripts with higher upgrade frequency from the basic function scripts with lower upgrade frequency, which helps to reduce the number of maintenance and upgrade operations for the basic function scripts with lower upgrade frequency, thereby reducing the probability of unnecessary upgrade and maintenance operations and improving the efficiency of application upgrade and maintenance.

[0011] In one possible implementation, the first storage space includes a remote server, and the step of re-uploading the upgraded business logic script to the first storage space further includes:

[0012] The business logic script obtains the first storage address corresponding to the business logic script to be upgraded, where the first storage address is the storage address on the remote server where the business logic script to be upgraded is stored.

[0013] The step of re-uploading the upgraded business logic script to the first storage space includes:

[0014] Upload the upgraded business logic script to the remote server according to the first storage address;

[0015] The process of re-uploading the upgraded business logic script to the first storage space further includes:

[0016] A clear mapping instruction is generated, which is used to clear the address mapping relationship between the first storage address and the second storage address corresponding to the business logic script to be upgraded in the execution mapping table, wherein the second storage address is the storage address of the business logic script to be upgraded stored in the first storage space.

[0017] By adopting the above technical solution, the upgraded business logic scripts are stored in the original storage location on the remote server, instead of being randomly stored. This facilitates the management of the business logic scripts. After the upgraded business logic scripts are uploaded to the server, the address mapping relationship between the first and second storage addresses of the business logic scripts to be upgraded in the execution mapping table is cleared. This reduces the probability of execution errors caused by incorrect address mapping references when executing the business logic scripts.

[0018] One possible implementation method for creating the mapping table includes:

[0019] Obtain the first and second storage addresses of each business logic script in the application, wherein the initial business logic script is a business logic script that has not undergone an upgrade operation;

[0020] Calculate the hash value corresponding to the first storage address of each initial business logic script;

[0021] The hash value of each initial business logic script is bound to the second storage address corresponding to each initial business logic script to obtain the address mapping relationship of each initial business logic script.

[0022] Key information is identified for each initial business logic script, and the importance level of each business logic script is determined based on the identification results. The initial business logic scripts are then sorted according to their importance levels to obtain an importance level sequence.

[0023] An execution mapping table is constructed based on the importance level sequence and the address mapping relationship corresponding to each initial business logic script.

[0024] By adopting the above technical solution, the hash value corresponding to each business logic script is calculated based on the storage address of each business logic script in the first storage space. Since the hash value can be used as the identity identifier of the business logic script, it is convenient to improve the efficiency of determining the target business logic script from multiple business logic scripts. Furthermore, the address mapping relationship of each business logic script is arranged according to the importance level of each business logic script, instead of randomly storing the address mapping relationships corresponding to all business logic scripts. Sorting facilitates the improvement of the speed of determining business logic scripts with higher importance levels.

[0025] In one possible implementation, the method further includes:

[0026] When a user-triggered execution request is detected, the business logic script to be executed is determined based on the execution request, and the first storage address of the business logic script to be executed is obtained.

[0027] Identify the address identifier in the first storage address of the business logic script to be executed, and determine the type of the business logic script to be executed based on the identified address identifier. The type includes remote script type and non-remote script type.

[0028] If the type of the business logic script to be executed is a remote script, then the execution hash value corresponding to the business logic script to be executed is calculated based on the first storage address of the business logic script to be executed, and the execution hash value is the hash value corresponding to the first storage address of the business logic script to be executed.

[0029] The execution hash value is used to traverse the execution mapping table to determine whether the business logic script to be executed is being called for the first time.

[0030] If so, based on the first storage address of the business logic script to be executed, cache the business logic script to be executed in the second storage space to obtain the second storage address, execute the business logic script to be executed, and update the execution mapping table based on the execution hash value of the business logic script to be executed and the second storage address of the business logic script to be executed;

[0031] If not, then the second storage address of the business logic script to be executed is determined from the execution mapping table based on the execution hash value, and the business logic script to be executed is executed based on the second storage address of the business logic script to be executed.

[0032] By adopting the above technical solution, when the business logic script to be executed is a remote script, the execution hash value corresponding to the first storage address of the business logic script to be executed is used to determine whether the business logic script is being called for the first time. If it is not being called for the first time, it is called directly. If it is being called for the first time, the business logic script to be executed is first downloaded from the remote server based on the first storage address and cached in the second storage space. Then, an address mapping relationship between the first storage address and the second storage address of the business logic script to be executed is generated. By caching the business logic script in the second storage space first and calling the business logic script according to the execution mapping table, the efficiency of calling the business logic script is improved. Furthermore, after the business logic script is called, the address mapping relationship corresponding to the executed business logic script is added to the execution mapping table to improve the efficiency of calling the business logic script again.

[0033] In one possible implementation, updating the execution mapping table based on the execution hash value of the business logic script to be executed and the second storage address of the business logic script to be executed further includes:

[0034] Obtain the data volume of the business logic script to be executed, and determine the second storage address of the business logic script to be executed in the second storage space based on the data volume of the business logic script to be executed;

[0035] The step of updating the execution mapping table based on the execution hash value of the business logic script to be executed and the second storage address of the business logic script to be executed includes:

[0036] The execution hash value corresponding to the business logic script to be executed is bound to the second storage address of the business logic script to be executed, so as to obtain the address mapping relationship of the business logic script to be executed;

[0037] Update the execution mapping table according to the address mapping relationship of the business logic script to be executed.

[0038] By adopting the above technical solution, the storage space for the business logic script to be executed is allocated in the second storage space based on the amount of data in the script, instead of storing it in a randomly allocated storage space. If the randomly allocated storage space cannot completely store the script, storage space needs to be allocated again, which may increase the workload in the storage allocation process. Furthermore, the two allocated storage spaces may not be adjacent, and random allocation may cause the script to be lost during storage. Determining the storage address of the business logic script in the second storage space based on its data volume ensures the integrity of the script and facilitates its management. Timely updating of the execution mapping table reduces the probability of calling errors when calling business logic scripts within the execution mapping table.

[0039] In one possible implementation, executing the business logic script to be executed includes:

[0040] Identify the association information in the business logic script to be executed, wherein the association information is the association information between the business logic script to be executed and the corresponding basic function script;

[0041] Based on the association information, a basic function script associated with the business logic script to be executed is determined from the second storage space, and the business logic script to be executed is merged with the basic function script to obtain a fused script, which is then executed.

[0042] By adopting the above technical solution, the associated information in the business logic script to be executed can be used to identify the basic function script associated with the business logic script to be executed. By merging the corresponding basic function script with the business logic script to be executed, and then running the merged script, the operation corresponding to the business logic script to be executed can be realized.

[0043] In one possible implementation, the method further includes:

[0044] The number of upgrade requests within a preset time period is counted, and the script corresponding to each upgrade request is determined. Scripts with fewer upgrade requests than a preset threshold are identified as abnormal scripts.

[0045] The upgrade frequency of each abnormal script is determined based on the number of upgrade requests for each abnormal script within the preset time period and the corresponding request adjustment time, wherein the request upgrade time is the time when the upgrade request is detected.

[0046] Based on the upgrade frequency of each abnormal script and the preset correspondence between the script and the standard upgrade frequency, expired scripts are identified and upgraded. The expired scripts are scripts whose upgrade frequency is lower than the corresponding standard upgrade frequency.

[0047] By adopting the above technical solution, based on the number of upgrade requests within a preset time period and the script corresponding to each upgrade request, scripts with abnormalities are identified. Based on the upgrade frequency corresponding to each abnormal script, overdue scripts are identified. By regularly upgrading overdue business logic scripts, vulnerabilities in the business logic scripts of the application can be discovered in a timely manner. Regularly upgrading potentially vulnerable business logic scripts in the application can reduce the probability of failures during application operation.

[0048] Secondly, this application provides an application upgrade and maintenance device, which adopts the following technical solution:

[0049] An application upgrade and maintenance device, comprising:

[0050] The script type determination module is used to determine the script type to be upgraded based on the upgrade request when a user-triggered upgrade request is detected. The script type to be upgraded includes business logic script type and basic function script type.

[0051] The business logic script upload module is used to obtain the business logic script to be upgraded when the type of the script to be upgraded is a business logic script, upgrade the business logic script to be upgraded to obtain the upgraded business logic script, and re-upload the upgraded business logic script to the first storage space.

[0052] The basic function script upload module is used to obtain the basic function script to be upgraded when the type of the script to be upgraded is a basic function script, perform mirror processing on the basic function script to be upgraded, and store the mirrored basic function script in the second storage space.

[0053] By adopting the above technical solution, after determining the type of script to be upgraded based on the upgrade request triggered by the user, the corresponding scripts in the application are then upgraded and maintained according to the upgrade request. Instead of upgrading and maintaining all scripts in the application at the same time when a user-triggered upgrade request is detected, the upgrade request determines the type of script to be upgraded, and then the scripts are upgraded and maintained according to the type of script to be upgraded. This distinguishes the business logic scripts with higher upgrade frequency from the basic function scripts with lower upgrade frequency, which helps to reduce the number of maintenance and upgrade operations for the basic function scripts with lower upgrade frequency, thereby reducing the probability of unnecessary upgrade and maintenance operations and improving the efficiency of application upgrade and maintenance.

[0054] In one possible implementation, the device further includes:

[0055] The business logic script first storage address acquisition module is used to acquire the first storage address corresponding to the business logic script to be upgraded, where the first storage address is the storage address on the remote server where the business logic script to be upgraded is stored.

[0056] Specifically, when the business logic script upload module re-uploads the upgraded business logic script to the first storage space, it is used for:

[0057] Upload the upgraded business logic script to the remote server according to the first storage address;

[0058] A clearing instruction module is used to generate a clearing mapping instruction. The clearing mapping instruction is used to clear the address mapping relationship between the first storage address and the second storage address corresponding to the business logic script to be upgraded in the execution mapping table. The second storage address is the storage address in the second storage space where the business logic script to be upgraded is stored.

[0059] In one possible implementation, the device further includes:

[0060] The address acquisition module is used to acquire the first and second storage addresses of each initial business logic script in the application, wherein the initial business logic script is a business logic script that has not undergone an upgrade operation.

[0061] The hash value calculation module is used to calculate the hash value corresponding to the first storage address of each initial business logic script.

[0062] The address mapping relationship determination module is used to bind the hash value of each initial business logic script and the second storage address corresponding to each initial business logic script to obtain the address mapping relationship of each initial business logic script.

[0063] The importance level sequence determination module is used to identify key information in each initial business logic script, determine the importance level of each initial business logic script based on the identification results, and sort the initial business logic scripts according to their importance levels to obtain the importance level sequence.

[0064] The mapping table module is used to construct an execution mapping table based on the importance level sequence and the address mapping relationship corresponding to each initial business logic script.

[0065] In one possible implementation, the device further includes:

[0066] The module for determining the business logic script to be executed is used to determine the business logic script to be executed based on the execution request when a user-triggered execution request is detected, and to obtain the first storage address of the business logic script to be executed.

[0067] A module for determining the type of business logic script is used to identify the address identifier in the first storage address of the business logic script to be executed, and to determine the type of the business logic script to be executed based on the identified address identifier. The type includes remote script type and non-remote script type.

[0068] The execution hash value determination module is used to calculate the execution hash value corresponding to the business logic script to be executed based on the first storage address of the business logic script to be executed if the type of the business logic script to be executed is a remote script type. The execution hash value is the hash value corresponding to the first storage address of the business logic script to be executed.

[0069] The traversal module is used to traverse the execution mapping table according to the execution hash value to determine whether the business logic script to be executed is being called for the first time.

[0070] The first execution module is configured to, if so, cache the business logic script to be executed in the second storage space to obtain a second storage address based on the first storage address of the business logic script to be executed, execute the business logic script to be executed, and update the execution mapping table based on the execution hash value of the business logic script to be executed and the second storage address of the business logic script to be executed.

[0071] The second execution module is used to determine the second storage address of the business logic script to be executed from the execution mapping table according to the execution hash value if no, and to execute the business logic script to be executed based on the second storage address of the business logic script to be executed.

[0072] In one possible implementation, the device further includes:

[0073] The data volume acquisition module is used to acquire the data volume of the business logic script to be executed, and determine the second storage address of the business logic script to be executed in the second storage space based on the data volume of the business logic script to be executed; wherein, when the first call execution module updates the execution mapping table based on the execution hash value of the business logic script to be executed and the second storage address of the business logic script to be executed, it is specifically used for:

[0074] The execution hash value corresponding to the business logic script to be executed is bound to the second storage address of the business logic script to be executed, so as to obtain the address mapping relationship of the business logic script to be executed;

[0075] Update the execution mapping table according to the address mapping relationship of the business logic script to be executed.

[0076] In one possible implementation, when the first or second execution module executes the business logic script to be executed, it specifically performs the following:

[0077] Identify the association information in the business logic script to be executed, wherein the association information is the association information between the business logic script to be executed and the corresponding basic function script;

[0078] Based on the association information, a basic function script associated with the business logic script to be executed is determined from the second storage space, and the business logic script to be executed is merged with the basic function script to obtain a fused script, which is then executed.

[0079] In one possible implementation, the device further includes:

[0080] The module for identifying abnormal scripts is used to count the number of adjustment requests within a preset time period and identify the script corresponding to each upgrade request. Scripts with a number of upgrade requests below a preset threshold are identified as abnormal scripts.

[0081] The upgrade frequency determination module is used to determine the upgrade frequency of each abnormal script based on the number of upgrade requests and the corresponding upgrade request time within the preset time period for each abnormal script, wherein the upgrade request time is the time when the upgrade request is detected; the overdue upgrade module is used to determine the overdue scripts based on the upgrade frequency of each abnormal script and the preset correspondence between the script and the standard upgrade frequency, and to upgrade the overdue scripts, wherein the overdue scripts are scripts whose upgrade frequency is lower than the corresponding standard upgrade frequency.

[0082] Thirdly, this application provides an electronic device that adopts the following technical solution:

[0083] An electronic device comprising:

[0084] At least one processor;

[0085] Memory;

[0086] At least one application, wherein the at least one application is stored in memory and configured to be executed by at least one processor, the at least one application being configured to: execute the application upgrade and maintenance method described above.

[0087] Fourthly, this application provides a computer-readable storage medium, which adopts the following technical solution:

[0088] A computer-readable storage medium includes: a computer program stored thereon that can be loaded by a processor and execute the application upgrade and maintenance method described above.

[0089] In summary, this application includes at least one of the following beneficial technical effects:

[0090] 1. After determining the type of script to be upgraded based on the user-triggered upgrade request, the corresponding scripts in the application are then upgraded and maintained according to the upgrade request. Instead of upgrading and maintaining all scripts in the application at the same time when a user-triggered upgrade request is detected, the upgrade request type is used to distinguish the business logic scripts with higher upgrade frequency from the basic function scripts with lower upgrade frequency. This helps to reduce the number of maintenance and upgrade operations on the low-upgrade-frequency basic function scripts, thereby reducing the probability of unnecessary upgrade and maintenance operations and improving the efficiency of application upgrade and maintenance.

[0091] 2. By storing the upgraded business logic scripts in the original storage location on the remote server, instead of storing them randomly, the upgraded business logic scripts can be better managed. After uploading the upgraded business logic scripts to the server, the address mapping relationship between the first and second storage addresses of the business logic scripts to be upgraded in the execution mapping table is cleared, which reduces the probability of execution errors caused by incorrect address mapping references when executing the business logic scripts. Attached Figure Description

[0092] Figure 1 This is a flowchart illustrating an application upgrade and maintenance method according to an embodiment of this application;

[0093] Figure 2 This is a flowchart of an adjustment script in an embodiment of this application;

[0094] Figure 3 This is a flowchart of a business logic script invocation in an embodiment of this application;

[0095] Figure 4 This is a schematic diagram of the structure of an application upgrade and maintenance device according to an embodiment of this application;

[0096] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation

[0097] The following is in conjunction with the appendix Figure 1-5 This application will be described in further detail.

[0098] After reading this specification, those skilled in the art may make modifications to this embodiment without contributing any inventive step, but such modifications are protected by patent law as long as they fall within the scope of the claims of this application.

[0099] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0100] Specifically, this application provides an application upgrade and maintenance method executed by an electronic device, which can be a server or a terminal device. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal device can be a smartphone, tablet, laptop, desktop computer, etc., but is not limited to these. The terminal device and the server can be directly or indirectly connected via wired or wireless communication, and this application does not impose any limitations on this connection.

[0101] refer to Figure 1 , Figure 1 This is a flowchart illustrating an application upgrade and maintenance method according to an embodiment of this application. The method includes steps S110, S120, and S130, wherein:

[0102] Step S110: When an upgrade request triggered by a user is detected, the type of script to be upgraded is determined based on the upgrade request. The types of scripts to be upgraded include business logic scripts and basic function scripts.

[0103] Specifically, upgrade requests can be generated automatically by the application, by the user inputting upgrade requirements, or by the user making configuration changes to the application's pages, such as setting up common buttons, navigation bars, or pop-ups. Once the user makes configuration changes within the application, a corresponding upgrade request will be generated. The upgrade request will then determine the corresponding adjustment operation, with each upgrade request corresponding to a specific upgrade operation.

[0104] An application contains multiple scripts. These scripts can be categorized into two types: business logic scripts and basic function scripts. Business logic scripts are unique to each user, have complex logic, and are closely related to user operations. Therefore, business logic scripts have a relatively high upgrade frequency. Basic function scripts are shared by multiple users, have simple and stable functions, and have simple logic. Therefore, basic function scripts have a lower upgrade frequency. To ensure a good user experience, the application needs to be regularly upgraded and maintained. For example, within a preset time period, business logic scripts may need to be upgraded and maintained four times, while basic function scripts may only need to be upgraded and maintained once.

[0105] Step S120: When the script type to be upgraded is a business logic script, obtain the business logic script to be upgraded, upgrade the business logic script to be upgraded, obtain the upgraded business logic script, and re-upload the upgraded business logic script to the first storage space.

[0106] Specifically, when determining the upgraded business logic script based on the upgrade request, the upgrade request is parsed to determine the business logic script to be upgraded. During the upgrade of the business logic script to be upgraded, the entire business logic script can be upgraded and maintained, or a user-specified portion of the business logic script can be upgraded and maintained. Among these:

[0107] Method 1: When an upgrade to the overall business logic script is required, the upgrade request is parsed to determine the functional nodes within the overall business logic script. Based on these determined functional nodes, the overall business logic script is divided, and then the functional nodes are sorted according to their importance to form a functional node sequence. The overall business logic script is then upgraded and maintained according to this functional node sequence. For example, in a shopping application, a user's overall business logic script includes login, browsing, purchasing, and favorites functional nodes. Based on the user's preset mapping relationship between functional nodes and their importance levels, the functional node sequence is determined to be login, purchasing, favorites, and browsing. When upgrading and maintaining the overall business logic script, the business logic script corresponding to each functional node is upgraded and maintained according to this functional node sequence.

[0108] Method 2: When upgrading a user-specified portion of the business logic script, the upgrade request is parsed to determine the corresponding target function node to be upgraded, and the position of the target function node is located in the overall business logic script. Then, the business logic script is upgraded and maintained based on the determined position.

[0109] The business logic scripts before the upgrade are stored in the first storage space, which can be a local cache space or a remote storage space. The upgraded business logic scripts are then re-uploaded to the first storage space to update the corresponding content stored in the first storage space.

[0110] Step S130: When the type of script to be upgraded is a basic function script, obtain the basic function script to be upgraded, perform mirror processing on the basic function script to be upgraded, and store the mirrored basic function script in the second storage space.

[0111] Specifically, the method for determining the upgraded basic function scripts based on the upgrade request can be found in the section on determining the upgraded business logic scripts based on the upgrade request, and will not be repeated here. The second storage space can be a local image, which can be a Docker image. Docker is an open-source application container engine that allows application developers to package their applications and dependencies, upload them, and publish the results to any Linux or Windows operating system device. Docker images can leverage Linux kernel features such as control groups and namespaces, and can directly call the operating system's system call interfaces to execute the corresponding application.

[0112] In this embodiment of the application, after determining the type of script to be upgraded based on the upgrade request triggered by the user, the corresponding script in the application is then upgraded and maintained according to the type of script to be upgraded. Instead of upgrading and maintaining all scripts in the application at the same time when an upgrade request triggered by the user is detected, the business logic scripts with higher upgrade frequency in the application are distinguished from the basic function scripts with lower upgrade frequency by the type of script to be upgraded. This makes it easier to reduce the number of times the basic function scripts with lower upgrade frequency need to be maintained and upgraded, thereby reducing the probability of unnecessary upgrade and maintenance operations and improving the efficiency of upgrading and maintaining the application.

[0113] To reduce the probability of errors when executing business logic scripts, step S120 involves re-uploading the upgraded business logic scripts to the first storage space. This is preceded by step Sa (not shown in the attached diagram), in which:

[0114] Step Sa: Obtain the first storage address corresponding to the business logic script to be upgraded. The first storage address is the storage address of the business logic script to be upgraded on the remote server.

[0115] Specifically, semantic recognition is performed on the upgrade request to facilitate the identification of the business logic script information to be upgraded included in the upgrade request. This business logic script facilitates the identification of the corresponding business logic script to be upgraded in the adjustment request. The first storage address of the business logic script to be upgraded is the storage address of the business logic script to be upgraded on a remote server. Here, the remote server refers to a remote access server, that is, a computer on the Internet connected to a remote access server on a local area network. Specifically, the remote server can be an S3 remote server or other remote servers; this application embodiment does not impose specific limitations, as long as it can remotely store the business logic script.

[0116] Step S120 involves re-uploading the upgraded business logic script to the first storage space, including step S1201 (not shown in the attached diagram), wherein:

[0117] Step S1201: Upload the upgraded business logic script to the remote server according to the first storage address.

[0118] Specifically, clear the contents of the business logic scripts stored in the first storage space before the upgrade, and store the upgraded business logic scripts in the same location as the original business logic scripts. When re-uploading the upgraded business logic scripts, they can be uploaded according to the storage address of the original business logic scripts in the first storage space.

[0119] Step 120 involves re-uploading the upgraded business logic script to the first storage space, followed by step Sb (not shown in the attached diagram), wherein:

[0120] Step Sb: Generate a clear mapping instruction. The clear mapping instruction is used to clear the address mapping relationship between the first storage address and the second storage address corresponding to the business logic script to be upgraded in the execution mapping table. The second storage address is the storage address of the business logic script to be upgraded stored in the second storage space.

[0121] Specifically, the clear mapping instruction is generated by the electronic device after the upgraded business logic script is uploaded to the first storage space. It is used to clear the address mapping relationship between the business logic script to be upgraded and the business logic script to be upgraded in the execution mapping table. For example, if the storage address of the business logic script to be upgraded, 'a', is A in the first storage space, and the business logic script to be executed is downloaded and cached from the first storage space to the second storage space, the corresponding second storage address is B, then the address mapping relationship between the first storage address A and the second storage address B of the business logic script to be upgraded is stored in the execution mapping table. If the business logic script to be upgraded, 'a', is upgraded to 'a1', then the business logic script to be upgraded stored in storage address A is replaced by the business logic script to be upgraded, 'a1'. The content stored in the first storage address A corresponding to the second storage address B in the execution mapping table is the business logic script to be upgraded, 'a'. If the script is called according to the execution mapping table at this time, errors may occur during the call process.

[0122] like Figure 2 As shown, Figure 2 This is a flowchart of an upgrade script in an embodiment of this application. When an upgrade request triggered by a user is detected, it is determined whether an upgrade is needed. If no upgrade is needed, the upgrade process ends. If an upgrade is needed, the business logic script is upgraded according to the upgrade request, and the upgraded business logic script is re-uploaded to the first storage space. After generating a clear mapping instruction, the upgrade process ends.

[0123] In this embodiment of the application, the upgraded business logic script is stored in the original storage location on the remote server, instead of being randomly stored, to facilitate the management of the business logic script. After the upgraded business logic script is uploaded to the server, the address mapping relationship between the first storage address and the second storage address of the business logic script to be upgraded in the execution mapping table is cleared to reduce the probability of execution errors caused by incorrect address mapping references when executing the business logic script.

[0124] To facilitate the execution of business logic scripts, this application provides an application upgrade and maintenance method, which further includes steps S1 (not shown in the attached figures), S2 (not shown in the attached figures), S3 (not shown in the attached figures), S4 (not shown in the attached figures), and S5 (not shown in the attached figures), wherein:

[0125] Step S1: Obtain the first and second storage addresses of each initial business logic script in the application. The initial business logic scripts are those that have not undergone upgrade operations.

[0126] Specifically, SaaS (Software as a Service) platforms are generally multi-user models, meaning that one instance of an application serves multiple users simultaneously. Each user has an independent business logic script. The first storage address is the storage address on the remote server where the business logic script to be upgraded is stored, and the second storage address is the storage address in the second storage space where the business logic script to be upgraded is stored.

[0127] Step S2: Calculate the hash value corresponding to the first storage address of each initial business logic script.

[0128] Specifically, each business logic script corresponds to different script features. These features are extracted from the business logic scripts, and multiple extracted features are encoded to obtain feature codes. A hash algorithm is then used to calculate the hash value for each business logic script. When encoding multiple script features, the encoding method can be ASCII, UTF-8, URL encoding, or Base64 encoding. ASCII only stores English characters, has 127 characters, and occupies one byte; UTF-8 encoding can store Chinese characters and occupies two bytes; URL encoding is an encoding method used by browsers when sending data, usually appended to the URL parameters. Since many servers can only recognize and encode ASCII characters, but URLs have their own independent encoding rules, the Java class library provides the URLEncoder class to encode arbitrary strings; Base64 encoding encodes binary data and converts it into text format. The specific encoding method is not specifically limited in this embodiment, as long as it can encode the identified script features.

[0129] A hash algorithm, or hash function, is a one-way cryptographic system, meaning it's an irreversible mapping from plaintext to ciphertext. Furthermore, a hash function can transform an input of arbitrary length to produce a fixed-length output. Through a hash algorithm, the feature encoding corresponding to a business logic script of arbitrary length can be mapped to a shorter, fixed-length binary value. This fixed-length binary value is called the hash value. The hash value is a unique and extremely compact numerical representation of a piece of data, and the corresponding business logic script can be determined through the hash value.

[0130] Step S3: Bind the hash value of each initial business logic script to the second storage address corresponding to each initial business logic script to obtain the address mapping relationship of each initial business logic script.

[0131] Specifically, after binding the hash value corresponding to each initial business logic script to the second storage address, the corresponding hash value can be determined through the second storage address. Since the corresponding business logic script can be determined through the hash value, the corresponding business logic script can also be determined through the second storage address.

[0132] Step S4: Identify key information for each initial business logic script, determine the importance level of each initial business logic script based on the identification results, and sort the initial business logic scripts according to their importance levels to obtain an importance level sequence.

[0133] Specifically, when identifying key information in business logic scripts, one can identify whether the script information corresponding to the business logic script contains preset keyword information. If the script information contains preset keyword information, the importance level of the script information can be determined by the importance level corresponding to the preset keyword information. The preset keyword information can be determined based on the business logic scripts that have been called multiple times in the historical call information.

[0134] Step S5: Construct an execution mapping table based on the importance level sequence and the address mapping relationship corresponding to each initial business logic script.

[0135] Specifically, the mapping relationships corresponding to multiple business logic scripts are arranged according to an importance level sequence. For example, there are four business logic scripts: Business Logic Script 1, Business Logic Script 2, Business Logic Script 3, and Business Logic Script 4. Each business logic script has a mapping relationship formed by binding a hash value to a second storage address. The importance level sequence formed by the four business logic scripts is Business Logic Script 1, Business Logic Script 3, Business Logic Script 4, and Business Logic Script 2. The execution mapping table constructed according to the importance level sequence can be found in Table 1.

[0136] Table 1

[0137] Business Logic Script 1 Mapping Relationship 1 Business Logic Script 3 Mapping Relationship 3 Business Logic Script 4 Mapping Relationship 4 Business Logic Script 2 Mapping Relationship 2

[0138] In this embodiment of the application, a hash value corresponding to each business logic script is calculated based on the storage address of each business logic script in the first storage space. Since the hash value can be used as an identifier for the business logic script, it is convenient to improve the efficiency of determining the target business logic script from multiple business logic scripts. Furthermore, the address mapping relationship of each business logic script is arranged according to the importance level of each business logic script, instead of randomly storing the address mapping relationships corresponding to all business logic scripts. Sorting facilitates the improvement of the speed when determining business logic scripts with higher importance levels.

[0139] To improve the efficiency of calling business logic scripts, the method further includes steps Sc1 (not shown in the attached figure), Sc2 (not shown in the attached figure), Sc3 (not shown in the attached figure), Sc4 (not shown in the attached figure), Sc5 (not shown in the attached figure), and Sc6 (not shown in the attached figure), wherein:

[0140] Step Sc1: When a user-triggered execution request is detected, the business logic script to be executed is determined based on the execution request, and the first storage address of the business logic script to be executed is obtained.

[0141] Step Sc2: Identify the address identifier in the first storage address of the business logic script to be executed, and determine the type of the business logic script to be executed based on the identified address identifier. The type includes remote script type and non-remote script type.

[0142] Specifically, the execution request contains the first storage address of the corresponding business logic script to be upgraded. The first storage address of the business logic script to be executed in the execution request can be determined by semantic recognition of the execution request. For example, if the first storage address of the business logic script to be executed is http_cache: / / http: / / ${bucket}.${region}.${domain} / companyID / scripts / trans_to_agent, it can be obtained from the execution request. The reference identifier in the execution request can be identified. The reference identifier is used to extract the first storage address of the business logic script to be executed. For example, the reference identifier can be lua. When the reference identifier is detected, the data after lua is the address of the business logic script to be executed. The reference identifier is not specifically limited in this embodiment of the application, as long as the first storage address of the corresponding business logic script to be executed in the execution request can be determined by the reference identifier.

[0143] The address identifier is located in the first storage address of the business logic script to be executed. The address identifier makes it easy to determine the type of the business logic script to be executed. For example, when the address identifier is "\", it indicates that the type of the business logic script to be executed is a non-remote script, and when the address identifier is " / / ", it indicates that the type of the business logic script to be executed is a remote script.

[0144] Step Sc3: If the type of the business logic script to be executed is a remote script, then calculate the execution hash value corresponding to the business logic script to be executed based on the first storage address of the business logic script to be executed. The execution hash value is the hash value corresponding to the first storage address of the business logic script to be executed.

[0145] Specifically, the method for determining the execution hash value of the business logic script to be executed can refer to the process of determining the hash value corresponding to the first storage address described above, and will not be repeated here.

[0146] Step Sc4: Traverse the execution mapping table based on the execution hash value to determine whether the business logic script to be executed is being called for the first time.

[0147] Specifically, when traversing the execution mapping table, the first hash value in the table can be determined as the target hash value. The target hash value is compared with the execution hash value, and the number of comparisons is recorded until the target hash value is the execution hash value, or the number of comparisons equals the number of hash values ​​in the execution mapping table, at which point the traversal ends. The execution hash value is compared with each hash value in the execution mapping table to determine whether the business logic script to be executed is being called for the first time. If the business logic script is being called for the first time, there is no corresponding execution hash value for that script in the execution mapping table; otherwise, there is a corresponding execution hash value in the execution mapping table.

[0148] Step Sc5: If the business logic script to be executed is being called for the first time, then based on the first storage address of the business logic script to be executed, cache the business logic script to be executed in the second storage space to obtain the second storage address, execute the business logic script to be executed, and update the execution mapping table based on the execution hash value of the business logic script to be executed and the second storage address of the business logic script to be executed.

[0149] Specifically, if the business logic script to be executed is being called for the first time, that is, if the execution hash value corresponding to the business logic script to be executed does not exist in the execution mapping table, the business logic script to be executed needs to be cached in the second storage space before execution. In order to facilitate the re-call of the business logic script to be executed, the execution hash value corresponding to the business logic script to be executed can be stored in the execution mapping table.

[0150] To improve the accuracy of calling business logic scripts from the execution mapping table, the method provided in this application embodiment further includes step Sd (not shown in the accompanying drawings), wherein:

[0151] Step Sd: Obtain the data volume of the business logic script to be executed, and determine the second storage address of the business logic script to be executed in the second storage space based on the data volume of the business logic script to be executed.

[0152] Specifically, the data volume of the business logic script to be executed is the number of files contained in the business logic script to be executed. The storage space required for the business logic script to be executed in the second storage space is determined by the number of files in the business logic script to be executed, and the corresponding storage address is allocated to the business logic script to be executed according to the required storage space.

[0153] In step Sc5, the execution mapping table is updated based on the execution hash value of the business logic script to be executed and the second storage address of the business logic script to be executed. This includes steps Sc51 (not shown in the attached figure) and Sc52 (not shown in the attached figure), wherein:

[0154] Step Sc51: Bind the execution hash value corresponding to the business logic script to be executed to the second storage address of the business logic script to be executed, so as to obtain the address mapping relationship of the business logic script to be executed.

[0155] Specifically, the second storage address is bound to the execution hash value corresponding to the business logic script to be executed. The execution hash value makes it easy to determine the second storage address of the business logic script to be executed, thereby facilitating the direct invocation of the business logic script to be executed through the second storage address.

[0156] Step Sc52: Update the execution mapping table according to the address mapping relationship of the business logic script to be executed.

[0157] Specifically, the execution mapping table is updated by writing the execution hash value corresponding to the business logic script to be executed for the first time into the execution mapping table, and writing the address mapping relationship of the business logic script to be executed into the execution mapping table. Before writing, the importance level of the business logic script to be executed and the business logic script written in the execution mapping table can be determined. The position of the address mapping relationship of the business logic script to be executed in the execution mapping table is determined according to the importance level of the business logic script to be executed, and the address mapping relationship of the business logic script to be executed is written and updated according to the determined position.

[0158] The storage address of the business logic script to be executed in the second storage space is determined by the amount of data in the script, rather than storing it in a randomly allocated storage space. If the randomly allocated storage space cannot completely store the script, storage space needs to be allocated again, which may increase the workload of the storage allocation process. Furthermore, the two allocated storage spaces may not be adjacent, and random allocation may result in the loss of the script during storage. Determining the storage address of the business logic script in the second storage space by the amount of data ensures the integrity of the script and facilitates its management. Timely updating of the execution mapping table reduces the probability of calling errors when calling business logic scripts within the execution mapping table.

[0159] Step Sc6: If the business logic script to be executed is not being called for the first time, then determine the second storage address of the business logic script to be executed from the execution mapping table based on the execution hash value, and execute the business logic script to be executed based on the second storage address of the business logic script to be executed.

[0160] Specifically, if the business logic script to be executed is not being called for the first time, then the execution mapping table contains the execution hash value corresponding to the business logic script to be executed. The execution hash value makes it easy to determine the second storage address corresponding to the business logic script to be executed, that is, the storage address in the second storage space.

[0161] like Figure 3 As shown, Figure 3 This is a flowchart illustrating a business logic script invocation process in an embodiment of this application. When a user-triggered execution request is detected, the address of the business logic script to be executed is determined based on the execution request. The first storage address of the business logic script to be executed is used to determine whether the script is a remote script. If the script is not a remote script, it is invoked and executed locally based on its address. If the script is a remote script, it is determined whether it is cached. If it is cached, indicating that this is not the first invocation, it is invoked and executed from the cache. If the script is a remote script and this is the first invocation, it is downloaded from the first storage space to the second storage space based on its first storage address. The execution hash value of the script's address is calculated, and the script is cached based on its execution hash value before execution.

[0162] In the embodiments of this application, when the business logic script to be executed is a remote script, the execution hash value corresponding to the first storage address of the business logic script to be executed is used to determine whether the business logic script is being called for the first time. If it is not being called for the first time, it is called directly. If it is being called for the first time, the business logic script to be executed is first downloaded from the remote server based on the first storage address and cached in the second storage space. Then, an address mapping relationship between the first storage address and the second storage address of the business logic script to be executed is generated. By caching the business logic script in the second storage space first and calling the business logic script logic according to the execution mapping table, the efficiency of calling the business logic script is improved. Furthermore, when the business logic script is called, the address mapping relationship corresponding to the executed business logic script is added to the execution mapping table to improve the efficiency of calling the business logic script again.

[0163] Further, in step Sc5 or step Sc6, executing the business logic script to be executed includes steps Se1 (not shown in the attached figure) and Se2 (not shown in the attached figure), wherein:

[0164] Step Se1: Identify the association information in the business logic script to be executed. The association information is the relationship between the business logic script to be executed and the corresponding basic function script.

[0165] Specifically, there is a relationship between business logic scripts and base scripts. Business logic scripts can call base scripts. The relationship between business logic scripts and base scripts can be determined by adding a relationship identifier to the business logic script and its corresponding base script. For example, base scripts can be basic page functions, pop-up functions, and navigation bar functions within a webpage framework. Therefore, the same business logic script may have multiple different associated base scripts, and the same base script may also have multiple different associated business logic scripts. The relationship information includes the storage path of the base script associated with executing the business logic script.

[0166] Step Se2: Based on the association information, determine the basic function script associated with the business logic script to be executed from the second storage space, merge the business logic script to be executed with the basic function script to obtain the fused script, and execute the fused script.

[0167] Specifically, the second storage space can be a local image. Based on the storage path of the base script, the base script is called from the local image. When merging the business logic script to be executed with the base script, the base script corresponding to each call interface can be determined by identifying the call interfaces present in the business logic script to be executed, thus enabling the merging of the business logic script to be executed with the associated base script. The merged script includes the business logic script to be executed and the associated base script.

[0168] In this embodiment of the application, the associated information in the business logic script to be executed makes it easy to determine the basic function script associated with the business logic script to be executed. By merging the corresponding basic function script with the business logic script to be executed, the merged script is then run to implement the operation corresponding to the business logic script to be executed.

[0169] To reduce the probability of application failures during operation, the method further includes steps Sf1 (not shown in the attached figures), Sf2 (not shown in the attached figures), and Sf3 (not shown in the attached figures), wherein:

[0170] Step Sf1: Count the number of upgrade requests within a preset time period, determine the script corresponding to each upgrade request, and identify scripts with fewer upgrade requests than a preset threshold as abnormal scripts.

[0171] Specifically, the preset time period can be 5 days, 7 days, or 15 days, which can be determined by the user. This embodiment does not impose a specific limitation. The number of upgrade requests issued can be obtained from the work log. When an upgrade request is detected, the time and number of times the upgrade request occurs are recorded in the work log, with the time of detection of the upgrade request being determined as the upgrade time. The preset threshold can be input by the user and is not specifically limited in this embodiment.

[0172] Step Sf2: Determine the upgrade frequency of each abnormal script based on the number of upgrade requests and the corresponding upgrade request time for each abnormal script within a preset time period. The upgrade request time is the moment when the upgrade request is detected.

[0173] Specifically, each upgrade request corresponds to a business logic script to be upgraded. The upgrade frequency of each upgrade request can be determined by the number of upgrades and the upgrade time. For example, if business logic script a is upgraded 5 times in 5 days and the interval between two adjacent upgrade times is more than 12 hours, the upgrade frequency of business logic script a can be determined to be 1 time per day. If business logic script b is upgraded 6 times in 6 days, but the interval between two adjacent upgrade times is less than 12 hours, the upgrade frequency of business logic script b is determined to be 2 times per day.

[0174] Step Sf3: Based on the upgrade frequency of each abnormal script and the preset correspondence between the script and the standard upgrade frequency, determine the expired scripts and upgrade the expired scripts. Expired scripts are scripts whose upgrade frequency is lower than the corresponding standard upgrade frequency.

[0175] Specifically, different business logic scripts have different upgrade frequencies. The correspondence between the preset business logic script and the standard upgrade frequency can be determined based on historical upgrade information or by the user. In this embodiment, no specific limitation is made. The standard upgrade frequency of the business logic script is the frequency that minimizes the probability of vulnerabilities occurring during the execution of the business logic script. If the upgrade frequency of the business logic script is lower than the corresponding standard upgrade frequency, the probability of vulnerabilities occurring during execution may increase.

[0176] Upgrading expired business logic scripts involves detecting and fixing potential vulnerabilities in them. Once the upgrade is complete, the electronic device generates a clear mapping instruction to remove the address mapping relationships of the expired business logic scripts within the execution mapping table.

[0177] In this embodiment of the application, based on the number of upgrade requests within a preset time period and the script corresponding to each upgrade request, scripts with abnormalities are identified, and overdue scripts are identified based on the upgrade frequency corresponding to each abnormal script. By regularly upgrading overdue business logic scripts, vulnerabilities in the business logic scripts of the application can be discovered in a timely manner. Regularly upgrading potentially vulnerable business logic scripts in the application can reduce the probability of failures during application operation.

[0178] The above embodiments describe an application upgrade and maintenance method from the perspective of process flow. The following embodiments describe an application upgrade and maintenance device from the perspective of virtual module or virtual unit. For details, please refer to the following embodiments.

[0179] This application provides an application upgrade and maintenance device, such as... Figure 4 As shown, the device may specifically include a script type determination module 410, a business logic script upload module 420, and a basic function script upload module 430, wherein:

[0180] The script type determination module 410 is used to determine the script type to be upgraded based on the upgrade request when a user-triggered upgrade request is detected. The script type to be upgraded includes business logic script type and basic function script type.

[0181] The business logic script upload module 420 is used to obtain the business logic script to be upgraded when the script to be upgraded is a business logic script, upgrade the business logic script to be upgraded, obtain the upgraded business logic script, and re-upload the upgraded business logic script to the first storage space.

[0182] The basic function script upload module 430 is used to obtain the basic function script to be upgraded when the type of the script to be upgraded is a basic function script, perform image processing on the basic function script to be upgraded, and store the image-processed basic function script in the second storage space.

[0183] In one possible implementation, the device further includes:

[0184] The Business Script Determination module is used to determine the business script to be adjusted based on the adjustment request.

[0185] The module for obtaining the first storage address is used to obtain the first storage address corresponding to the business logic script to be upgraded. The first storage address is the storage address on the remote server where the business logic script to be upgraded is stored.

[0186] Specifically, when the business logic script upload module 420 re-uploads the upgraded business logic script to the first storage space, it is used for:

[0187] Upload the upgraded business logic script to the remote server according to the first storage address;

[0188] The module for generating clearing instructions is used to generate clearing mapping instructions. The clearing mapping instructions are used to clear the address mapping relationship between the first storage address and the second storage address corresponding to the business logic script to be upgraded in the execution mapping table. The second storage address is the storage address of the business logic script to be upgraded stored in the second storage space.

[0189] In one possible implementation, the device further includes:

[0190] The address acquisition module is used to obtain the first and second storage addresses of each initial business logic script in the application. The initial business logic scripts are business logic scripts that have not undergone upgrade operations.

[0191] The hash value calculation module is used to calculate the hash value corresponding to the first storage address of each initial business logic script; the address mapping relationship determination module is used to bind the hash value of each initial business logic script and the second storage address corresponding to each initial business logic script to obtain the address mapping relationship of each initial business logic script.

[0192] The importance level sequence determination module is used to identify key information in each initial business logic script, determine the importance level of each initial business logic script based on the identification results, and sort the initial business logic scripts according to their importance levels to obtain the importance level sequence.

[0193] The mapping table module is used to construct the execution mapping table based on the importance level sequence and the address mapping relationship corresponding to each initial business logic script.

[0194] In one possible implementation, the device further includes:

[0195] The module for determining the address of the business logic script to be executed is used to determine the business logic script to be executed based on the execution request when a user-triggered execution request is detected, and to obtain the first storage address of the business logic script to be executed.

[0196] The module for determining the type of business logic script is used to identify the address identifier in the first storage address of the business logic script to be executed, and to determine the type of the business logic script to be executed based on the identified address identifier. The types include remote script type and non-remote script type.

[0197] The module for determining the execution hash value is used to calculate the execution hash value corresponding to the business logic script to be executed based on the first storage address of the business logic script to be executed if the type of the business logic script to be executed is a remote script. The execution hash value is the hash value corresponding to the first storage address of the business logic script to be executed.

[0198] The traversal module is used to traverse the execution mapping table based on the execution hash value to determine whether the business logic script to be executed is being called for the first time.

[0199] The first execution module is used to, if the business logic script to be executed is being called for the first time, cache the business logic script to be executed in the second storage space based on the first storage address of the business logic script to be executed to obtain the second storage address, execute the business logic script to be executed, and update the execution mapping table based on the execution hash value of the business logic script to be executed and the second storage address of the business logic script to be executed.

[0200] The second execution module is used to determine the second storage address of the business logic script to be executed from the execution mapping table based on the execution hash value if the business logic script to be executed is not being called for the first time, and to execute the business logic script to be executed based on the second storage address of the business logic script to be executed.

[0201] In one possible implementation, the device further includes:

[0202] The data volume acquisition module is used to acquire the data volume of the business logic script to be executed, and determine the second storage address of the business logic script to be executed in the second storage space based on the data volume of the business logic script to be executed.

[0203] Specifically, when the first execution module updates the execution mapping table based on the execution hash value of the business logic script to be executed and the second storage address of the business logic script to be executed, it is used for:

[0204] The execution hash value corresponding to the business logic script to be executed is bound to the second storage address of the business logic script to be executed, so as to obtain the address mapping relationship of the business logic script to be executed;

[0205] Update the execution mapping table based on the address mapping relationship of the business logic script to be executed.

[0206] In one possible implementation, when the first or second execution module executes the business logic script to be executed, it is specifically used for:

[0207] Identify the association information in the business logic script to be executed. The association information is the relationship between the business logic script to be executed and the corresponding basic function script.

[0208] Based on the associated information, the basic function script associated with the business logic script to be executed is determined from the second storage space, and the business logic script to be executed and the basic function script are merged to obtain a fused script, which is then executed.

[0209] In one possible implementation, the device further includes:

[0210] The module for counting adjustment requests and the module for identifying abnormal scripts are used to count the number of adjustment requests within a preset time period and identify the script corresponding to each upgrade request. Scripts with a number of upgrade requests lower than a preset threshold are identified as abnormal scripts.

[0211] The module for determining the upgrade adjustment frequency is used to determine the upgrade frequency of each abnormal script based on the number of upgrade requests for each abnormal script within a preset time period and the corresponding upgrade request time. The upgrade request time is the moment when the upgrade request is detected.

[0212] The expired upgrade module is used to identify expired scripts based on their upgrade frequency and the preset correspondence between the scripts and the standard upgrade frequency, and then upgrades these expired scripts. Expired scripts are those whose upgrade frequency is lower than the corresponding standard upgrade frequency.

[0213] This application provides an electronic device, such as... Figure 5 As shown, Figure 5The illustrated electronic device 500 includes a processor 501 and a memory 503. The processor 501 and the memory 503 are connected, for example, via a bus 502. Optionally, the electronic device 500 may also include a transceiver 504. It should be noted that in practical applications, the transceiver 504 is not limited to one type, and the structure of this electronic device 500 does not constitute a limitation on the embodiments of this application.

[0214] Processor 501 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 501 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0215] Bus 502 may include a pathway for transmitting information between the aforementioned components. Bus 502 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 502 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0216] The memory 503 may be a ROM (Read Only Memory) or other type of static storage device capable of storing static information and instructions, RAM (Random Access Memory) or other type of dynamic storage device capable of storing information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.

[0217] The memory 503 is used to store application code that executes the solution of this application, and its execution is controlled by the processor 501. The processor 501 is used to execute the application code stored in the memory 503 to implement the content shown in the foregoing method embodiments.

[0218] Electronic devices include, but are not limited to: mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and in-vehicle terminals (such as in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Servers can also be included. Figure 5 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0219] This application provides a computer-readable storage medium storing a computer program that, when run on a computer, enables the computer to execute the corresponding content in the aforementioned method embodiments.

[0220] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by 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 accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0221] The above description is only a partial embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for upgrading and maintaining an application, characterized in that, include: When a user-triggered upgrade request is detected, the type of script to be upgraded is determined based on the upgrade request. The type of script to be upgraded includes business logic script type and basic function script type. When the type of script to be upgraded is a business logic script, the business logic script to be upgraded is obtained, the business logic script to be upgraded is upgraded to obtain the upgraded business logic script, and the upgraded business logic script is re-uploaded to the first storage space. When the type of the script to be upgraded is a basic function script, the basic function script to be upgraded is obtained, the basic function script to be upgraded is mirrored, and the mirrored basic function script is stored in the second storage space. The first storage space includes a remote server, and the step of re-uploading the upgraded business logic script to the first storage space includes, prior to: Obtain the first storage address corresponding to the business logic script to be upgraded, where the first storage address is the storage address on the remote server where the business logic script to be upgraded is stored; The step of re-uploading the upgraded business logic script to the first storage space includes: Upload the upgraded business logic script to the remote server according to the first storage address; The process of re-uploading the upgraded business logic script to the first storage space further includes: A clear mapping instruction is generated, which is used to clear the address mapping relationship between the first storage address and the second storage address corresponding to the business logic script to be upgraded in the execution mapping table, wherein the second storage address is the storage address of the business logic script to be upgraded stored in the second storage space.

2. The application upgrade maintenance method of claim 1, wherein, The methods for creating the mapping table include: Obtain the first and second storage addresses of each initial business logic script in the application, wherein the initial business logic script is a business logic script that has not undergone an upgrade operation; Calculate the hash value corresponding to the first storage address of each initial business logic script; The hash value of each initial business logic script is bound to the second storage address corresponding to each initial business logic script to obtain the address mapping relationship of each initial business logic script. Key information is identified for each initial business logic script. The importance level of each initial business logic script is determined based on the identification results. The initial business logic scripts are then sorted according to their importance level to obtain an importance level sequence. An execution mapping table is constructed based on the importance level sequence and the address mapping relationship corresponding to each initial business logic script.

3. The application upgrade maintenance method of claim 1, wherein, Also includes: When a user-triggered execution request is detected, the business logic script to be executed is determined based on the execution request, and the first storage address of the business logic script to be executed is obtained. Identify the address identifier in the first storage address of the business logic script to be executed, and determine the type of the business logic script to be executed based on the identified address identifier. The type includes remote script type and non-remote script type. If the type of the business logic script to be executed is a remote script, then the execution hash value corresponding to the business logic script to be executed is calculated based on the first storage address of the business logic script to be executed, and the execution hash value is the hash value corresponding to the first storage address of the business logic script to be executed. The execution hash value is used to traverse the execution mapping table to determine whether the business logic script to be executed is being called for the first time. If so, based on the first storage address of the business logic script to be executed, cache the business logic script to be executed in the second storage space to obtain the second storage address, execute the business logic script to be executed, and update the execution mapping table based on the execution hash value of the business logic script to be executed and the second storage address of the business logic script to be executed; If not, then the second storage address of the business logic script to be executed is determined from the execution mapping table based on the execution hash value, and the business logic script to be executed is executed based on the second storage address of the business logic script to be executed.

4. The application upgrade maintenance method of claim 3, wherein, The step of updating the execution mapping table based on the execution hash value of the business logic script to be executed and the second storage address of the business logic script to be executed also includes: Obtain the data volume of the business logic script to be executed, and determine the second storage address of the business logic script to be executed in the second storage space based on the data volume of the business logic script to be executed; The step of updating the execution mapping table based on the execution hash value of the business logic script to be executed and the second storage address of the business logic script to be executed includes: The execution hash value corresponding to the business logic script to be executed is bound to the second storage address of the business logic script to be executed, so as to obtain the address mapping relationship of the business logic script to be executed; Update the execution mapping table according to the address mapping relationship of the business logic script to be executed.

5. The application upgrade maintenance method of claim 3, wherein, The execution of the business logic script to be executed includes: Identify the association information in the business logic script to be executed, wherein the association information is the association information between the business logic script to be executed and the corresponding basic function script; Based on the association information, a basic function script associated with the business logic script to be executed is determined from the second storage space, and the business logic script to be executed is merged with the basic function script to obtain a fused script, which is then executed.

6. The application upgrade maintenance method of claim 1, wherein, Also includes: The number of upgrade requests within a preset time period is counted, and the script corresponding to each upgrade request is determined. Scripts with fewer upgrade requests than a preset threshold are identified as abnormal scripts. The upgrade frequency of each abnormal script is determined based on the number of upgrade requests and the corresponding upgrade request time for each abnormal script within the preset time period, wherein the upgrade request time is the moment when the upgrade request is detected. Based on the upgrade frequency of each abnormal script and the preset correspondence between the script and the standard upgrade frequency, expired scripts are identified and upgraded. The expired scripts are scripts whose upgrade frequency is lower than the corresponding standard upgrade frequency.

7. An application upgrade maintenance apparatus characterized by comprising: include: The script type determination module is used to determine the script type to be upgraded based on the upgrade request when a user-triggered upgrade request is detected. The script type to be upgraded includes business logic script type and basic function script type. The business logic script upload module is used to obtain the business logic script to be upgraded when the type of the script to be upgraded is a business logic script, upgrade the business logic script to be upgraded to obtain the upgraded business logic script, and re-upload the upgraded business logic script to the first storage space. The basic function script upload module is used to obtain the basic function script to be upgraded when the script to be upgraded is a basic function script, perform mirror processing on the basic function script to be upgraded, and store the mirrored basic function script in the second storage space. The first storage space includes a remote server; Also includes: The module for obtaining the first storage address is used to obtain the first storage address corresponding to the business logic script to be upgraded, wherein the first storage address is the storage address on the remote server where the business logic script to be upgraded is stored; Specifically, when the business logic script upload module re-uploads the upgraded business logic script to the first storage space, it is used for: The upgraded business logic script is re-uploaded to the first storage space; A module for generating clearing instructions is used to generate clearing mapping instructions. The clearing mapping instructions are used to clear the address mapping relationship between the first storage address and the second storage address corresponding to the business logic script to be upgraded in the execution mapping table. The second storage address is the storage address in the second storage space where the business logic script to be upgraded is stored.

8. An electronic device, comprising: The electronic device includes: At least one processor; Memory; at least one application, wherein the at least one application is stored in memory and configured to be executed by at least one processor, the at least one application being configured to: perform an application upgrade and maintenance method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, include: The computer program is stored and can be loaded by a processor and executed as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Method for upgrading mobile terminal

    CN106940649A

  • Automatically identifying available storage components

    US20090313395A1