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

By receiving the target version number of the server during the hot update process and evaluating the stability of the update package, the lag and crash problems caused by excessive resource consumption during the hot update process are solved, and a more stable and reliable update process is achieved.

CN119759398APending Publication Date: 2025-04-04镁佳(北京)科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411807309.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

During the hot update process, the application needs to consume a lot of memory and CPU resources, resulting in the application stuttering and crashing during the update process.

Method used

The target version number sent by the receiving server and compare it with the initial version number. If the difference is less than a certain threshold, the corresponding update package will be received, ensuring that updates will only be performed if necessary, and unnecessary downloads and installations will be avoided. At the same time, an evaluation mechanism for download index and stable index is introduced, and the update package is evaluated at any time during the download process, ensuring the stability and availability of the update package.

Benefits of technology

It effectively avoids unnecessary updates, ensures sufficient system resources, reduces lag or crash problems caused by insufficient resources, and improves the stability and reliability of the update process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759398A_ABST
    Figure CN119759398A_ABST
Patent Text Reader

Abstract

The present invention relates to the field of computer technology, and discloses an application update method, device, computer equipment, storage medium and program product. The method comprises: receiving a target version number sent by a server; if the difference between the target version number and the initial version number is less than a first threshold, receiving an update package corresponding to the target version number, and determining a download index of the update package at a target time; wherein the target time is any time in the process of downloading the update package; if the download index of the update package at the target time is not greater than a second threshold, determining a stability index of the update package at the target time; if the stability index is not less than the minimum value of a preset threshold range, not greater than the maximum value of the preset threshold, and the state of the update package belongs to the target state, updating the application through the update package.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an application updating method, device, computer equipment, storage medium and program product. Background Art

[0002] During the hot update process, the application will first check whether there is an available update package. If so, it will download and install the update package. The update package usually contains the business code and resource files that need to be updated. These files will be dynamically loaded and replaced by the application after downloading.

[0003] However, the hot update process consumes a lot of memory and CPU resources to load and replace code and resources, causing the application to freeze or crash during the update process. Summary of the invention

[0004] In view of this, the present invention provides an application updating method, apparatus, computer equipment, storage medium and program product.

[0005] In a first aspect, the present invention provides an application update method, the method comprising: receiving a target version number sent by a server; if the difference between the target version number and the initial version number is less than a first threshold, receiving an update package corresponding to the target version number, and determining a download index of the update package at a target time; wherein the target time is any time in the process of downloading the update package; if the download index of the update package at the target time is not greater than a second threshold, determining a stability index of the update package at the target time; if the stability index is not less than the minimum value of a preset threshold range, not greater than the maximum value of the preset threshold, and the state of the update package belongs to the target state, updating the application through the update package.

[0006] The application update method provided in this embodiment receives the target version number sent by the server and compares it with the initial version number. If the difference is less than a certain threshold, the corresponding update package will be received, ensuring that the update is only performed when necessary, avoiding unnecessary downloads and installations. At the same time, an evaluation mechanism for the download index and stability index is introduced to evaluate the update package at any time during the download process, ensuring the stability and availability of the update package.

[0007] In one possible implementation, determining the download index of the update package at the target time includes: obtaining the initial memory, occupied memory, actual power storage, actual power consumption corresponding to the target time, the maximum power between the initial stage and the target time, the minimum power between the initial stage and the target time, and the size of the update package; determining the download index of the update package at the target time based on the initial memory, occupied memory, actual power storage, actual power consumption corresponding to the target time, the maximum power between the initial stage and the target time, the minimum power between the initial stage and the target time, and the size of the update package.

[0008] The application update method provided in this embodiment can more comprehensively evaluate the current system resource status by comprehensively considering the memory usage (initial memory and occupied memory) and power status (actual power storage, actual power consumption corresponding to the target time, and maximum and minimum power between the initial stage and the target time). This helps to ensure that system resources are sufficient when downloading and installing update packages, thereby avoiding problems such as freezing or flashbacks caused by insufficient resources.

[0009] In one possible implementation, determining the stability index of the update package at the target time includes: obtaining an influence weight coefficient of the network speed, a CPU occupancy rate corresponding to the target time, an ambient temperature corresponding to the target time, and a preset hot update temperature; determining the stability index of the update package at the target time based on the influence weight coefficient of the network speed, the CPU occupancy rate corresponding to the target time, the ambient temperature corresponding to the target time, and the preset hot update temperature.

[0010] The application update method provided in this embodiment can more comprehensively reflect the stability status of the update package at the target time by introducing multiple evaluation indicators. These indicators cover multiple aspects such as network environment, hardware performance (CPU occupancy), physical environment (ambient temperature) and preset conditions (hot update temperature), thereby ensuring the accuracy and comprehensiveness of the evaluation. At the same time, after comprehensively considering multiple factors, it is possible to more accurately judge whether the update package is suitable for updating at the target time. For example, if the network speed is slow or the CPU occupancy rate is high, you may choose to postpone the update to avoid affecting the user experience. This optimization decision can ensure a smoother update process and reduce problems such as jamming and flashbacks caused by updates.

[0011] In one possible implementation, the process of obtaining the influence weight coefficient of the network speed includes: obtaining the network download speed corresponding to the target time, the average network download speed between the initial time and the target time, the maximum network download speed between the initial time and the target time, and the minimum network download speed between the initial time and the target time; determining the influence weight coefficient of the network speed according to the network download speed corresponding to the target time, the average network download speed between the initial time and the target time, the maximum network download speed between the initial time and the target time, and the minimum network download speed between the initial time and the target time.

[0012] The application update method provided in this embodiment can more accurately reflect the changes and fluctuations in network conditions by obtaining network download speed data at different time points (including the instantaneous speed, average speed, maximum speed and minimum speed at the target time). This helps to more accurately evaluate the impact of network speed on the stability of update package downloads. At the same time, comprehensively considering multiple speed data to determine the impact weight coefficient of network speed can improve the accuracy of the evaluation. This helps to more accurately determine whether the network speed is suitable for downloading and installing update packages, thereby avoiding update failures or reduced user experience when the network conditions are poor.

[0013] In a possible implementation, receiving the update package corresponding to the target version number includes: receiving multiple sub-update packages in parallel through multiple threads; wherein the update package is composed of the multiple sub-update packages.

[0014] The application update method provided in this embodiment can fully utilize the network bandwidth by downloading in parallel through multi-threads, so as to realize the simultaneous reception of multiple sub-update packages. Compared with single-thread downloading, multi-thread downloading can significantly increase the download speed and shorten the waiting time of users.

[0015] In a possible implementation, the method further includes: restarting the application; detecting whether the version number corresponding to the restarted application is consistent with the target version number; if the version number corresponding to the restarted application is consistent with the target version number, it indicates that the application update is successful;

[0016] or,

[0017] The restarted application is tested to generate a test result; if the test result meets the preset test result, it indicates that the application update is successful.

[0018] In the application update method provided in this embodiment, restarting the application is an important part of the update process, which ensures that the new code and resources can be correctly loaded and applied. By detecting whether the application version number after restart is consistent with the target version number, it is possible to intuitively verify whether the update is successfully executed. This verification mechanism improves the reliability and accuracy of the update process. In addition, by testing the application and generating test results to compare with preset test results, it is possible to intuitively verify whether the update is successfully executed. This verification mechanism improves the reliability and accuracy of the update process.

[0019] In a second aspect, the present invention provides an application update device, which includes: a target version number receiving module, used to receive the target version number sent by the server; a first determination module, used to receive the update package corresponding to the target version number if the difference between the target version number and the initial version number is less than a first threshold, and determine the download index of the update package at the target time; wherein the target time is any time in the process of downloading the update package; a second determination module, used to determine the stability index of the update package at the target time if the download index of the update package at the target time is not greater than a second threshold; an update module, used to update the application through the update package if the stability index is not less than the minimum value of the preset threshold range, not greater than the maximum value of the preset threshold, and the state of the update package belongs to the target state.

[0020] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the application update method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0021] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the application updating method of the first aspect or any corresponding embodiment thereof.

[0022] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the application updating method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0024] Figure 1 is a flowchart of an application updating method according to an embodiment of the present invention;

[0025] Figure 2 is a schematic diagram of an application updating method according to an embodiment of the present invention;

[0026] Figure 3 is a structural block diagram of an application updating device according to an embodiment of the present invention;

[0027] Figure 4 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0029] Based on relevant technologies, during the hot update process, the application will first check whether there is an available update package. If so, it will download and install the update package. The update package usually contains the business code and resource files that need to be updated. These files will be dynamically loaded and replaced by the application after downloading.

[0030] However, the hot update process consumes a lot of memory and CPU resources to load and replace code and resources, causing the application to freeze or crash during the update process.

[0031] Based on this, the present invention provides an application update method, which receives the target version number sent by the server and compares it with the initial version number. If the difference is less than a certain threshold, the corresponding update package will be received, ensuring that the update is only performed when necessary, avoiding unnecessary downloads and installations. At the same time, an evaluation mechanism for the download index and stability index is introduced, and the update package is evaluated at any time during the download process to ensure the stability and availability of the update package.

[0032] According to an embodiment of the present invention, an application update method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0033] In this embodiment, an application update method is provided, which can be used in computer devices, such as computers, servers, etc. Figure 1 is a flow chart of an application updating method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0034] Step S101, receiving the target version number sent by the server.

[0035] The target version number can represent the version number that the application needs to hot-update. For example, if the current version of the software is version A, and the version after the hot-update is version B, then the version number corresponding to version B is the target version number. Specifically, the target version number can be configured by the user on the server side, or by other means, which is not specifically limited here and can be implemented by those skilled in the art.

[0036] Step S102, if the difference between the target version number and the initial version number is less than the first threshold, receive the update package corresponding to the target version number, and determine the download index of the update package at the target time; wherein the target time is any time in the process of downloading the update package.

[0037] The initial version number can represent the current version number of the application, and the first threshold can represent a critical point at which the application can be hot-updated. Among them, when the difference between the target version number and the initial version number is less than the first threshold, the application can be updated. Specifically, before downloading the update package, it is necessary to detect whether the difference between the target version number and the initial version number of the application has exceeded the first threshold. If the difference between the target version number and the initial version number is less than the first threshold, the update package corresponding to the target version number can be received. Among them, the update package is used to represent a data packet containing the new version application code and resources.

[0038] As an example, V server -V current >μ; where V server is the target version number sent by the server, V current is the initial version number of the application currently installed on the user terminal, and μ is the preset hot update threshold (ie, the first threshold mentioned above).

[0039] The target time can be any time during the process of downloading the update package. The download index is used to indicate the performance indicators at the target time during the download of the update package, such as download speed, download progress, etc. During the process of downloading the update package corresponding to the target version number, it is necessary to determine the download index of the update package at the target time, that is, to monitor the download index in real time during the download process.

[0040] Step S103: if the download index of the update package at the target time is not greater than the second threshold, determine the stability index of the update package at the target time.

[0041] The second threshold can represent a critical point at which the application can be hot-updated. The second threshold can be F1, or F2, etc., which is not specifically limited here. It can be seen from the above content that in the process of downloading the update package corresponding to the target version number, it is necessary to determine the download index of the update package at the target time. When the download index at the target time is not greater than the second threshold, it represents that the download index at the target time meets the download requirements, and the stability index at the target time can be further determined. The stability index at the target time indicates an indicator that represents the stability and reliability of the update package at the target time.

[0042] In one possible implementation, when the download index at the target time is greater than the second threshold, it indicates that the update package does not meet the download requirements. In this case, it is necessary to stop downloading the update package, and then process the current process until the download index at the target time is no greater than the second threshold, and then continue to download the update package from the target time.

[0043] Step S104: if the stability index is not less than the minimum value of the preset threshold range and not greater than the maximum value of the preset threshold, and the state of the update package belongs to the target state, the application is updated through the update package.

[0044] The preset threshold range can represent the range in which the update package can be downloaded. That is, when the stability index is within the preset threshold range, the update package can continue to be downloaded. Specifically, if the stability index is not less than the minimum value of the preset threshold range and not greater than the maximum value of the preset threshold, the update package can continue to be downloaded at the target time. When the status of the update package belongs to the target status, it indicates that the update package has been completely downloaded and the application can be updated through the update package.

[0045] In one possible implementation, when the stability index at the target moment is not within the preset threshold range, it indicates that the update package does not meet the download requirements. In this case, it is necessary to stop downloading the update package, and then process the current process until the stability index at the target moment is within the preset threshold range, and then continue to download the update package from the target moment.

[0046] The application update method provided in this embodiment receives the target version number sent by the server and compares it with the initial version number. If the difference is less than a certain threshold, the corresponding update package will be received, ensuring that the update is only performed when necessary, avoiding unnecessary downloads and installations. At the same time, an evaluation mechanism for the download index and stability index is introduced to evaluate the update package at any time during the download process, ensuring the stability and availability of the update package.

[0047] In a possible implementation, determining the download index of the update package at the target time in step S102 includes:

[0048] Step a1, obtain the initial memory, occupied memory, actual power storage, actual power consumption corresponding to the target time, maximum power between the initial time and the target time, minimum power between the initial stage and the target time, and the size of the update package.

[0049] The initial memory can represent the memory after the hot update terminal (the terminal where the application is located) is initialized, and the occupied memory can represent the memory occupied by existing applications and other memory-occupying programs in the hot update terminal. The actual power storage can represent the actual capacity of the hot update terminal. The actual power consumption corresponding to the target time can represent the power consumed by downloading the update package at the target time. The maximum power between the initial time and the target time is used to represent the maximum power from the start of downloading the update package to the target time. For example: the initial time is 1s and the target time is 5s, then the maximum power is the maximum power within 1s to 5s. The minimum power between the initial time and the target time is used to represent the minimum power from the start of downloading the update package to the target time. For example: the initial time is 1s and the target time is 5s, then the minimum power is the minimum power within 1s to 5s.

[0050] It should be noted that when the target time is not the initial time, the actual power consumption corresponding to the target time is determined by the sum of the power consumption at all times from the initial time to the target time. When the target time is the initial time, the actual power consumption corresponding to the target time is the actual power consumption corresponding to the initial time.

[0051] It should be noted that the update package is downloaded simultaneously during the process of receiving the update package, that is, the above-mentioned initial memory, occupied memory, actual power storage capacity, actual power consumption corresponding to the target moment, maximum power between the initial moment and the target moment, minimum power between the initial stage and the target moment and the size of the update package are all detected in real time.

[0052] Step a2, determines the download index of the update package at the target time based on the initial memory, occupied memory, actual power storage capacity, actual power consumption corresponding to the target time, maximum power between the initial stage and the target time, minimum power between the initial stage and the target time, and the size of the update package.

[0053] After obtaining the initial memory, occupied memory, actual power storage, actual power consumption corresponding to the target time, maximum power between the initial stage and the target time, minimum power between the initial stage and the target time, and the size of the update package, the download index of the update package at the target time can be determined based on calculation.

[0054] As an example, calculate the remaining storage space: initial memory - occupied memory. Determine whether the update package size is smaller than the remaining storage space. If so, the device storage is sufficient. At the same time, consider the actual power storage, the actual power consumption corresponding to the target moment, and the maximum and minimum power between the initial stage and the target moment. Calculate the power adequacy index, such as (maximum power - actual power consumption) / power required to download the update package. Combine the results of the device storage evaluation and the power status evaluation to determine the final download index. Specifically, methods such as weighted average or setting a threshold can be used to combine the two evaluation results.

[0055] As an example, Among them, I download is the download index of the hot update installation package, S ud is the actual update package size, M is the initial memory, m is the occupied memory, E is the actual power storage, time is the target time, and e i is the actual power consumed by the hot update terminal at the ith second during the software hot update process, e max is the maximum power consumed by the hot update terminal within time, e min is the minimum power consumed by the hot update terminal within the time period, and φ is the second threshold of the preset download index. download When ≤φ, it indicates that the current download index meets the requirements.

[0056] The application update method provided in this embodiment can more comprehensively evaluate the current system resource status by comprehensively considering the memory usage (initial memory and occupied memory) and power status (actual power storage, actual power consumption corresponding to the target time, and maximum and minimum power between the initial stage and the target time). This helps to ensure that system resources are sufficient when downloading and installing update packages, thereby avoiding problems such as freezing or flashbacks caused by insufficient resources.

[0057] In a possible implementation, determining the stability index of the update package at the target time in step S103 includes:

[0058] Step b1, obtaining the influence weight coefficient of the network speed, the CPU occupancy rate corresponding to the target time, the ambient temperature corresponding to the target time, and the preset hot update temperature.

[0059] The CPU occupancy rate corresponding to the target time represents the CPU usage rate at the target time (i.e., the time point when the update package is planned to be downloaded). A high CPU occupancy rate may mean that the hot update terminal is performing other tasks, which may affect the download and installation stability of the update package. The preset hot update temperature may be the optimal software hot update temperature, which can be obtained by manual setting.

[0060] The ambient temperature corresponding to the target time may represent the ambient temperature corresponding to the location of the hot update terminal at the target time.

[0061] As an example, the ambient temperature corresponding to the target time can be directly predicted by the location at the target time. For example, if the location at the target time is indoors, the ambient temperature corresponding to the target time can be X, if the location at the target time is outdoors, the ambient temperature corresponding to the target time can be Y, etc., which is not specifically limited here.

[0062] As an example, the ambient temperature corresponding to the target time can be determined by devices such as an ambient temperature detector and an ambient temperature sensor configured in the hot update terminal. The ambient temperature corresponding to the target time can be directly determined by the ambient temperature sensor.

[0063] The network speed influence weight coefficient can represent the coefficient measuring the influence of network speed on the stability of update package download. It reflects the importance of network speed in determining whether the update package download is stable.

[0064] As an example, the influence weight coefficient of the network speed can be determined by the network download speed corresponding to the target time, the average network download speed between the initial time and the target time, the maximum network download speed between the initial time and the target time, and the minimum network download speed between the initial time and the target time. It can also be determined by artificial settings, etc., which is not specifically limited here and can be implemented by technical personnel in this field.

[0065] Step b2, determining the stability index of the update package at the target time according to the influence weight coefficient of the network speed, the CPU occupancy rate corresponding to the target time, the ambient temperature corresponding to the target time, and the preset hot update temperature.

[0066] After determining the influence weight coefficient of the network speed, the CPU occupancy rate corresponding to the target time, the ambient temperature corresponding to the target time, and the preset hot update temperature, the stability index of the update package at the target time is determined.

[0067] As an example, a threshold value may be set for each parameter, and if the value of a parameter exceeds the threshold value, the stability index decreases. For example, if the CPU usage exceeds 80%, the stability index decreases by a certain score.

[0068] As an example, a machine learning algorithm is used to train a model that is able to predict the download and installation stability of an update package based on input parameters.

[0069] As an example, Among them, I stability is the stability index, C effactis the influence weight coefficient of network speed, time is the target time, usage i is the CPU occupancy rate, T standard is the preset thermal update temperature, T i is the location of the hot update terminal obtained by hot update terminal positioning, the ambient temperature corresponding to the target time, and δ is the third threshold. stability ∈[1-δ, 1+δ], then the stability index meets the download requirements.

[0070] The application update method provided in this embodiment can more comprehensively reflect the stability status of the update package at the target time by introducing multiple evaluation indicators. These indicators cover multiple aspects such as network environment, hardware performance (CPU occupancy), physical environment (ambient temperature) and preset conditions (hot update temperature), thereby ensuring the accuracy and comprehensiveness of the evaluation. At the same time, after comprehensively considering multiple factors, it is possible to more accurately judge whether the update package is suitable for updating at the target time. For example, if the network speed is slow or the CPU occupancy rate is high, you may choose to postpone the update to avoid affecting the user experience. This optimization decision can ensure a smoother update process and reduce problems such as jamming and flashbacks caused by updates.

[0071] In a possible implementation, obtaining the influence weight coefficient of the network speed in the above step b1 includes:

[0072] Step b11, obtaining the network download speed corresponding to the target time, the average network download speed between the initial time and the target time, the maximum network download speed between the initial time and the target time, and the minimum network download speed between the initial time and the target time.

[0073] The network download speed corresponding to the target time may be the rate at which the terminal acquires data at the specific time point (target time) when the update package is planned to be downloaded. The average speed of the network download between the initial time and the target time is the average rate at which the device downloads data from the initial recording time point to the target time. The maximum speed of the network download between the initial time and the target time may be the highest rate at which the hot update terminal downloads data from the initial time to the target time. The minimum speed of the network download between the initial time and the target time may be the lowest rate at which the hot update terminal downloads data from the initial time to the target time.

[0074] It should be noted that the network download speed corresponding to the target time, the average network download speed between the initial time and the target time, the maximum network download speed between the initial time and the target time, and the minimum network download speed between the initial time and the target time can all be obtained through real-time collection or real-time calculation.

[0075] Step b12, determining the influence weight coefficient of the network speed according to the network download speed corresponding to the target time, the average network download speed between the initial time and the target time, the maximum network download speed between the initial time and the target time, and the minimum network download speed between the initial time and the target time.

[0076] After determining the network download speed corresponding to the target time, the average network download speed between the initial time and the target time, the maximum network download speed between the initial time and the target time, and the minimum network download speed between the initial time and the target time, determine the influence weight coefficient of the network speed.

[0077] As an example, the correlation between these indicators is analyzed using statistical methods (such as the Pearson correlation coefficient) to determine which indicators have a greater impact on network speed. Based on the results of the correlation analysis, a weight coefficient is assigned to each indicator. For example, the indicator with the highest correlation with the target moment speed may be assigned a higher weight.

[0078] As an example, various indicators of network download speed are input as features into a machine learning model. The model is trained using historical data to predict network speed or evaluate network performance. The weight coefficients of the features are extracted from the trained model. These weight coefficients reflect the contribution of each feature (i.e., an indicator of network speed) to the model's prediction results.

[0079] As an example, Among them, C effact is the influence weight coefficient of network speed, time is the target time, V i is the network download speed, V age is the average network download speed, V max is the maximum speed of network download, V min The minimum download speed of the network.

[0080] The application update method provided in this embodiment can more accurately reflect the changes and fluctuations in network conditions by obtaining network download speed data at different time points (including the instantaneous speed, average speed, maximum speed and minimum speed at the target time). This helps to more accurately evaluate the impact of network speed on the stability of update package downloads. At the same time, comprehensively considering multiple speed data to determine the impact weight coefficient of network speed can improve the accuracy of the evaluation. This helps to more accurately determine whether the network speed is suitable for downloading and installing update packages, thereby avoiding update failures or reduced user experience when the network conditions are poor.

[0081] In a possible implementation, receiving the update package corresponding to the target version number in step S102 includes: receiving multiple sub-update packages in parallel through multiple threads; wherein the update package is composed of multiple sub-update packages.

[0082] The complete update package is split into multiple sub-update packages. Specifically, each sub-update package should contain enough information for the client to identify and process after receiving it. On the client, a thread pool is created to manage multiple threads. The size of the thread pool can be adjusted according to the hardware resources of the system and the expected load. The task of receiving each sub-update package is assigned to the threads in the thread pool. This can be achieved through a task queue, where each task is an operation to receive a specific sub-update package. The threads in the thread pool will take the task from the task queue and execute it. The threads in the thread pool begin to receive the sub-update packages in parallel. Since each thread runs independently, they can receive different sub-update packages at the same time, thereby improving the parallelism of data reception. After receiving the sub-update package, the thread can perform corresponding data processing. Specifically, it can include steps such as decompression, decryption, and integrity verification. After processing, the data can be integrated into the complete update package or passed to other modules for further processing.

[0083] Since multiple threads process sub-update packages in parallel, you may need to consider synchronization and merging issues. You can use locks, semaphores, or other synchronization mechanisms to ensure data consistency between threads. When merging sub-update packages, you need to ensure their order and integrity.

[0084] The application update method provided in this embodiment can fully utilize the network bandwidth by downloading in parallel through multi-threads, so as to realize the simultaneous reception of multiple sub-update packages. Compared with single-thread downloading, multi-thread downloading can significantly increase the download speed and shorten the waiting time of users.

[0085] In a possible implementation, the method further includes:

[0086] Step c1: restart the application.

[0087] After the application is updated through the update package, it needs to be restarted so that the application can load and run the new version.

[0088] Step c2, checking whether the version number corresponding to the restarted application is consistent with the target version number.

[0089] After the application is started, the current version number can be obtained by reading a configuration file, database, or a variable in the code, and the obtained current version number can be compared with the target version number. Specifically, a string or number comparison operation can be performed.

[0090] Step c3: If the version number corresponding to the restarted application is consistent with the target version number, it indicates that the application is updated successfully.

[0091] If the current version number matches the target version number, the application can be considered to have been successfully updated to the target version. At this point, the application can continue to run normally and display information about the successful update to the user (such as pop-ups, log records, etc.).

[0092] In the application update method provided in this embodiment, restarting the application is an important step in the update process, which ensures that the new code and resources can be correctly loaded and applied. By detecting whether the application version number after restart is consistent with the target version number, it is possible to intuitively verify whether the update is successfully executed. This verification mechanism improves the reliability and accuracy of the update process.

[0093] In a possible implementation, the method further includes:

[0094] Step d1, testing the restarted application and generating test results.

[0095] After the application restarts and loads the new version, a series of tests are required to ensure that the functionality and performance of the new version meet expectations. These tests may include, but are not limited to: Functional testing: Verify that each function in the new version works as expected. Performance testing: Evaluate the running speed and resource usage of the new version under specific conditions. Compatibility testing: Ensure that the new version is compatible with different operating systems, devices, and browsers. Security testing: Check whether the new version has security vulnerabilities or weaknesses. The testing process should be recorded in detail and a test result report should be generated. The test results may include items that passed the test, items that failed, error messages, and recommended fixes.

[0096] Step d2: If the test result meets the preset test result, it indicates that the application update is successful.

[0097] Preset test results are usually a set of expected results or standards used to measure whether the new version meets specific quality requirements. These preset results may be based on factors such as previous testing experience, industry standards, or user feedback. When comparing the actual test results with the preset test results, ensure that the actual test results are consistent with the preset results on key points. In some cases, small differences between the actual test results and the preset results may be allowed (for example, small fluctuations in performance indicators). For any test items that do not meet the preset results, detailed analysis and investigation are required to determine the cause and solution of the problem. If the actual test results meet the preset test results, the application update can be considered successful. At this point, the new version can be released to all users, and the performance and user feedback of the application can continue to be monitored.

[0098] The application update method provided in this embodiment can intuitively verify whether the update is successfully executed by testing the application and generating a test result to compare with the preset test result. This verification mechanism improves the reliability and accuracy of the update process.

[0099] Please refer to Figure 2 , Figure 2 The present invention provides an application update method according to an embodiment of the present invention.

[0100] Combination Figure 2 As shown, the preparation before hot update installation: prepare the code and resources that need to be updated on the server, package the updated code and resources, generate an update package, and update the version number on the server.

[0101] Detection of the version to be updated: The user terminal obtains the latest version number from the server, and detects the latest version number on the server and the version number of the app currently installed on the user terminal to determine whether the Android app needs to be updated. In the process of detecting the hot update version, the latest version number on the server is compared with the version number of the app currently installed on the user terminal. When the difference between the latest version number on the server and the version number of the app currently installed on the user terminal is greater than the preset hot update threshold, the update package is downloaded.

[0102] It should be noted that in actual applications, developers will set a reasonable preset hot update threshold T based on the update frequency of the application, user usage habits, and the size of the update package. For example, if the application is updated very frequently, and each update contains important functional improvements or security fixes, then the developer may set a smaller T value to ensure that users can get the latest features and services as soon as possible. On the contrary, if the application is updated infrequently, or each update contains a large number of new features and resources, then the developer may set a larger T value to reduce unnecessary update operations and improve the user experience.

[0103] Check download requirements: Before downloading the update package, the power and memory information data of the user terminal is collected in real time, and the collected parameters are input into the processing and analysis system to determine whether the user terminal meets the download requirements.

[0104] Download stability testing: On the basis of meeting the download requirements, the CPU occupancy, temperature and network download speed information data of the user terminal are collected in real time, and the collected parameters are input into the processing and analysis system to determine whether the user terminal is downloading stably.

[0105] Download of hot update resources: On the basis of stable download, the user terminal starts to download the hot update resources. In order to increase the download speed, multi-threaded download technology is adopted to divide the update package into several parts for parallel download, which effectively improves the download efficiency.

[0106] To update an Android app: The user terminal starts the update operation, decompresses the downloaded update package, extracts the code and resource files, and then replaces the decompressed new code and resource files to the corresponding location of the user terminal, overwriting the old files and completing the update. After the update is completed, the application usually needs to be restarted for the update to take effect. Before restarting, the user can be prompted to save the current work or data. After restarting, the client can verify whether the update was successful, for example, by checking the version number or running some basic tests to ensure that the new code can work properly.

[0107] In this embodiment, an application update device is also provided, which is used to implement the above embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0108] This embodiment provides an application update device, such as Figure 3 As shown, it includes: a target version number receiving module 301, used to receive the target version number sent by the server; a first determination module 302, used to receive the update package corresponding to the target version number if the difference between the target version number and the initial version number is less than a first threshold, and determine the download index of the update package at the target time; wherein the target time is any moment in the process of downloading the update package; a second determination module 303, used to determine the stability index of the update package at the target time if the download index of the update package at the target time is not greater than the second threshold; an update module 304, used to update the application through the update package if the stability index is not less than the minimum value of the preset threshold range, not greater than the maximum value of the preset threshold, and the state of the update package belongs to the target state.

[0109] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0110] The application update device in this embodiment is presented in the form of a functional unit, where the functional unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0111] The embodiment of the present invention also provides a computer device having the above Figure 3 An update device for the application shown.

[0112] See also Figure 4 , Figure 4 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 4 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 4 A processor 10 is taken as an example.

[0113] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0114] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0115] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0116] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0117] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0118] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0119] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0120] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. An application update method, characterized in that: The method comprises: Receive the target version number sent by the server; If the difference between the target version number and the initial version number is less than a first threshold, receiving an update package corresponding to the target version number, and determining a download index of the update package at a target time; wherein the target time is any time in the process of downloading the update package; If the download index of the update package at the target time is not greater than the second threshold, determining the stability index of the update package at the target time; If the stability index is not less than a minimum value of a preset threshold range, not greater than a maximum value of a preset threshold, and the state of the update package belongs to a target state, the application is updated through the update package.

2. The application updating method according to claim 1, characterized in that: Determining the download index of the update package at the target time includes: Get the initial memory, occupied memory, actual power storage, actual power consumption corresponding to the target time, maximum power between the initial time and the target time, minimum power between the initial stage and the target time, and the size of the update package; The download index of the update package at the target time is determined based on the initial memory, occupied memory, actual power storage, actual power consumption corresponding to the target time, maximum power between the initial stage and the target time, minimum power between the initial stage and the target time, and the size of the update package.

3. The application updating method according to claim 1, characterized in that: Determine the stability index of the update package at the target time, including: Obtain the influence weight coefficient of network speed, the CPU occupancy rate corresponding to the target time, the ambient temperature corresponding to the target time, and the preset hot update temperature; The stability index of the update package at the target time is determined according to the influence weight coefficient of the network speed, the CPU occupancy rate corresponding to the target time, the ambient temperature corresponding to the target time, and the preset hot update temperature.

4. The application updating method according to claim 3, characterized in that: The process of obtaining the influence weight coefficient of network speed includes: Obtain the network download speed corresponding to the target time, the average network download speed between the initial time and the target time, the maximum network download speed between the initial time and the target time, and the minimum network download speed between the initial time and the target time; The influence weight coefficient of the network speed is determined according to the network download speed corresponding to the target time, the average network download speed between the initial time and the target time, the maximum network download speed between the initial time and the target time, and the minimum network download speed between the initial time and the target time.

5. The application updating method according to claim 1, characterized in that: Receiving an update package corresponding to the target version number includes: Multiple sub-update packages are received in parallel through multiple threads; wherein the update package is composed of multiple sub-update packages.

6. The application updating method according to claim 1, characterized in that: The method further comprises: Restarting the application; Check whether the version number of the restarted application is consistent with the target version number; If the version number corresponding to the restarted application is consistent with the target version number, it indicates that the application update is successful; or, Testing the restarted application and generating a test result; If the test result meets the preset test result, it indicates that the application update is successful.

7. An application updating device, characterized in that: The device comprises: The target version number receiving module is used to receive the target version number sent by the server; A first determination module, configured to receive an update package corresponding to the target version number and determine a download index of the update package at a target time if the difference between the target version number and the initial version number is less than a first threshold, wherein the target time is any time in the process of downloading the update package; A second determination module, configured to determine a stability index of the update package at the target time if the download index of the update package at the target time is not greater than a second threshold; The update module is used to update the application through the update package if the stability index is not less than the minimum value of the preset threshold range and not greater than the maximum value of the preset threshold, and the state of the update package belongs to the target state.

8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the application updating method according to any one of claims 1 to 6 by executing the computer instructions.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the application updating method according to any one of claims 1 to 6.

10. A computer program product, characterized in that The invention comprises computer instructions, wherein the computer instructions are used to make a computer execute the application updating method according to any one of claims 1 to 6.