Mobile terminal and download interface updating method thereof
By calculating the current download volume of the installation package in the mobile terminal, the difference between the ratio of the amount of the installation package and the historical download volume, if the difference is greater than or equal to the threshold, the download interface will be updated. The update problem improves the update efficiency and accuracy of the interface.
Patent Information
- Application Number
- CN202010415130.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-15
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2040-05-15
AI Technical Summary
When the mobile terminal downloads the installation package, if the network conditions are poor or the update period is short, it may cause invalid update of the progress bar.
In the processor of the mobile terminal, the ratio of the current download volume of the installation package to the historical download volume is calculated. If the difference is greater than or or equal to the set threshold, the download interface is updated.
It avoids invalid updates caused by fixed update cycles and improves the update efficiency and accuracy of the download interface.
Smart Images

Figure CN113672249B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of display technology, and in particular to a mobile terminal and a download interface update method thereof. Background Art
[0002] When the mobile terminal is downloading the installation package, a progress bar indicating the download progress of the installation package may be displayed and the progress bar may be continuously updated.
[0003] In the related art, when downloading an installation package, the mobile terminal can detect the current download amount of the installation package according to a fixed update cycle, and update the progress bar based on the current download amount until the download is completed.
[0004] However, in the related art, when the network condition is poor or the update cycle is short, the download amount of the installation package may not change within multiple update cycles, thereby causing the mobile terminal to invalidly update the progress bar. Summary of the invention
[0005] The present application provides a mobile terminal and a download interface update method thereof, which can solve the problem of invalid update of progress bar by mobile terminal in related art. The technical solution is as follows:
[0006] In one aspect, a mobile terminal is provided, the mobile terminal comprising a processor and a display screen; the processor is used to:
[0007] During the process of downloading the installation package, determining a first ratio of a current download amount of the installation package to a size of the installation package;
[0008] If it is detected that the difference between the first ratio and the second ratio is greater than or equal to the ratio threshold, updating the download interface of the mobile terminal according to the current download amount;
[0009] The second ratio is a ratio of the historical download volume of the installation package to the size of the installation package, and the historical download volume is the download volume of the installation package when the download interface was last updated;
[0010] The display screen is used to display the download interface.
[0011] Optionally, a first thread and a second thread are running in the processor;
[0012] The first thread is used to determine a first ratio of a current download amount of the installation package to a size of the installation package during the process of downloading the installation package; if it is detected that a difference between the first ratio and the second ratio is greater than or equal to a ratio threshold, send an interface update instruction to the second thread;
[0013] The second thread is used to respond to the interface update instruction and update the download interface according to the current download amount.
[0014] Optionally, the processor is used to:
[0015] The ratio threshold is determined according to the size of the installation package, and the ratio threshold is negatively correlated with the size of the installation package.
[0016] In another aspect, a mobile terminal is provided, the mobile terminal comprising a processor and a display screen; the processor is configured to:
[0017] Determining a difference threshold according to the size of the installation package to be downloaded, wherein the difference threshold is positively correlated with the size of the installation package;
[0018] During the process of downloading the installation package, determining the current download amount of the installation package;
[0019] If it is detected that the difference between the current download amount and the historical download amount is greater than or equal to the difference threshold, updating the download interface of the mobile terminal according to the current download amount;
[0020] The historical download volume is the download volume of the installation package when the download interface was last updated;
[0021] The display screen is used to display the download interface.
[0022] Optionally, a first thread and a second thread are running in the processor;
[0023] The first thread is used to determine the current download amount of the installation package during the process of downloading the installation package; if it is detected that the difference between the current download amount and the historical download amount is greater than or equal to the difference threshold, send an interface update instruction to the second thread;
[0024] The second thread is used to respond to the interface update instruction and update the download interface according to the current download amount.
[0025] Optionally, the processor is used to:
[0026] The product of the size of the installation package and the ratio threshold is determined as the difference threshold.
[0027] In another aspect, a mobile terminal is provided, the mobile terminal comprising a processor and a display screen; the processor is configured to:
[0028] Determine a number threshold according to the size of the installation package to be downloaded, where the number threshold is positively correlated with the size of the installation package;
[0029] During the process of downloading the installation package, determining the current data write count of the installation package, the current data write count being the cumulative number of times the data of the installation package is currently written to the storage space of the mobile terminal, wherein the amount of data written to the storage space each time is the unit download amount;
[0030] If it is detected that the difference between the current data writing times and the historical data writing times is greater than or equal to the times threshold, updating the download interface of the mobile terminal according to the current download amount of the installation package;
[0031] The historical data writing times is the data writing times of the installation package when the download interface was last updated, and the current download amount is determined based on the unit download amount and the current data writing times;
[0032] The display screen is used to display the download interface.
[0033] In another aspect, a method for updating a download interface of a mobile terminal is provided, the method comprising:
[0034] During the process of downloading the installation package, determining a first ratio of a current download amount of the installation package to a size of the installation package;
[0035] If it is detected that the difference between the first ratio and the second ratio is greater than or equal to the ratio threshold, updating the download interface of the mobile terminal according to the current download amount;
[0036] The second ratio is a ratio of the historical download volume of the installation package to the size of the installation package, and the historical download volume is the download volume of the installation package when the download interface was last updated.
[0037] In another aspect, a method for updating a download interface of a mobile terminal is provided, the method comprising:
[0038] Determining a difference threshold according to the size of the installation package to be downloaded, wherein the difference threshold is positively correlated with the size of the installation package;
[0039] During the process of downloading the installation package, determining the current download amount of the installation package;
[0040] If it is detected that the difference between the current download amount and the historical download amount is greater than or equal to the difference threshold, updating the download interface according to the current download amount;
[0041] The historical download volume is the download volume of the installation package when the download interface was last updated.
[0042] In another aspect, a method for updating a download interface of a mobile terminal is provided, the method comprising:
[0043] Determine a number threshold according to the size of the installation package to be downloaded, where the number threshold is positively correlated with the size of the installation package;
[0044] During the process of downloading the installation package, determining the current data write count of the installation package, the current data write count being the cumulative number of times the data of the installation package is currently written to the storage space of the mobile terminal, wherein the amount of data written to the storage space each time is the unit download amount;
[0045] If it is detected that the difference between the current data writing times and the historical data writing times is greater than the times threshold, updating the download interface according to the current download amount;
[0046] The historical data writing times is the data writing times of the installation package when the download interface was last updated, and the current download amount is determined based on the unit download amount and the current data writing times.
[0047] On the other hand, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the download interface update method for a mobile terminal as described in the above aspects.
[0048] On the other hand, a computer program product comprising instructions is provided, and when the computer program product is executed on the computer, the computer is enabled to execute the download interface update method for the mobile terminal described in the above aspects.
[0049] The beneficial effects of the technical solution provided by this application include at least:
[0050] The present application provides a mobile terminal and a download interface update method thereof, wherein the mobile terminal can update the download interface based on the current download amount when it detects that the difference between the first ratio of the current download amount of the installation package and the size of the installation package and the second ratio is greater than or equal to the ratio threshold, or when it detects that the difference between the current download amount of the installation package and the historical download amount is greater than or equal to the difference threshold, or when it detects that the current data write count of the installation package and the historical data write count are greater than or equal to the count threshold, that is, when the current download amount of the mobile terminal has a significant change compared to the historical download amount after the previous update. Since the mobile terminal updates the download interface only when the current download amount has a significant change compared to the historical download amount after the previous update, rather than periodically updating the download interface according to a fixed update cycle, invalid updates to the download interface can be avoided. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0052] Figure 1 It is a structural diagram of an implementation environment involved in the download interface update method of a mobile terminal provided in an embodiment of the present application;
[0053] Figure 2 It is a flow chart of a download interface updating method of a mobile terminal provided in an embodiment of the present application;
[0054] Figure 3 is a flowchart of another method for updating a download interface of a mobile terminal provided in an embodiment of the present application;
[0055] Figure 4 is a schematic diagram of a download interface of a mobile terminal provided in an embodiment of the present application;
[0056] Figure 5 This is a flowchart of another method for updating a download interface of a mobile terminal provided in an embodiment of the present application;
[0057] Figure 6 is a flowchart of another method for updating a download interface of a mobile terminal provided in an embodiment of the present application;
[0058] Figure 7 is a flowchart of another method for updating a download interface of a mobile terminal provided in an embodiment of the present application;
[0059] Figure 8 is a flowchart of another method for updating a download interface of a mobile terminal provided in an embodiment of the present application;
[0060] Fig. 9 is a structural schematic diagram of a mobile terminal provided in an embodiment of the present application;
[0061] Fig.10 It is a software structure block diagram of the mobile terminal provided in the embodiment of the present application. DETAILED DESCRIPTION
[0062] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0063] Figure 1 1 is a schematic diagram of a structure of an implementation environment involved in the method for updating the download interface of a mobile terminal provided in an embodiment of the present application. Figure 1The implementation environment may include: a mobile terminal 110 and an application server 120. The mobile terminal 110 may establish a communication connection with the application server 120.
[0064] The mobile terminal 110 has an application 110a installed therein. The application server 120 may be a background server of the application.
[0065] Optionally, the mobile terminal 110 may be a smart phone, a tablet computer, a wearable device, etc. The application server 120 may be a server, or a server cluster consisting of a plurality of servers, or a cloud computing service center.
[0066] In the embodiment of the present application, when the mobile terminal 110 detects that the application installed therein has a new version, the mobile terminal 110 may display update prompt information to prompt the user to update the application. In the process of the mobile terminal 110 updating the application, the mobile terminal 110 may send a request to obtain the installation package of the new version of the application 110a to the application server 120, and the application server 120 may respond to the acquisition request and send the installation package to the mobile terminal 110. The mobile terminal 110 can receive the installation package and update the application based on the installation package.
[0067] For example, the mobile terminal 110 may display Figure 1 The update prompt message shown is "! Version update found, please click to download".
[0068] Optionally, the implementation environment may further include: an over-the-air technology (OTA) server, which may be connected to the mobile terminal 110. Before the mobile terminal 110 sends the acquisition request to the application server 120, it may first send an update request to the OTA server 120, and the update request may carry an identifier of the application 110a and a version identifier of the current version of the application 110a.
[0069] After receiving the update request, the OTA server can determine the download address of the installation package of the application corresponding to the application 110a and the application with a higher version than the current version based on the identification of the application 110a and the version identification, and send the download address to the mobile terminal 110. The download address is the Internet protocol (IP) address of the background server of the application 110a (i.e., the application server 120). After receiving the download address, the mobile terminal 110 can access the application server 120 based on the download address and send a request to the application server 120 to obtain the installation package.
[0070] Figure 2 1 is a flow chart of a method for updating a download interface of a mobile terminal provided in an embodiment of the present application. The method can be applied to a mobile terminal, for example Figure 1 The mobile terminal 110 is shown. Figure 2 , the method may include:
[0071] Step 101: Determine a difference threshold according to the size of the installation package to be downloaded.
[0072] The difference threshold is positively correlated with the size of the installation package. That is, the larger the installation package, the larger the difference threshold, and the smaller the installation package, the smaller the difference threshold. The size of the installation package may refer to the size of the storage space required by the installation package.
[0073] Step 102: During the process of downloading the installation package, determine the current download amount of the installation package.
[0074] In the embodiment of the present application, during the process of downloading the installation package, the mobile terminal can write the data included in the installation package to the local of the mobile terminal in multiple times, and each time can write the data of the unit download amount to the local. Moreover, after each time the mobile terminal writes the data of the unit download amount, it can also calculate the download amount of the data currently written to the local, that is, the current download amount of the installation package.
[0075] Step 103: If it is detected that the difference between the current download amount and the historical download amount is greater than or equal to the difference threshold, the download interface is updated according to the current download amount.
[0076] In the embodiment of the present application, after determining the current download amount of the installation package, the mobile terminal can determine the difference between the current download amount and the historical download amount, and compare the difference with the difference threshold. If it is determined that the difference is greater than or equal to the difference threshold, the mobile terminal can update the download interface of the mobile terminal according to the current download amount. The historical download amount is the download amount of the installation package when the download interface was last updated.
[0077] In summary, the embodiment of the present application provides a method for updating the download interface of a mobile terminal, wherein the mobile terminal can determine a difference threshold based on the size of the installation package to be downloaded, and can update the download interface based on the current download amount when it is detected that the difference between the current download amount and the historical download amount of the installation package is greater than or equal to the difference threshold. Since the difference threshold is positively correlated with the size of the installation package, and the mobile terminal updates the download interface only when the difference between the current download amount and the historical download amount of the installation package is greater than or equal to the difference threshold, that is, when the current download amount of the mobile terminal has a significant change compared to the historical download amount after the previous update, rather than periodically updating the download interface according to a fixed update cycle, invalid updates of the download interface can be avoided.
[0078] Figure 3 1 is a flow chart of another method for updating the download interface of a mobile terminal provided in an embodiment of the present application. The method can be applied to a mobile terminal, for example Figure 1 The mobile terminal 110 shown in FIG. 1 may include a first thread and a second thread running in the mobile terminal 110. Figure 3 , the method may include:
[0079] Step 201: The first thread determines a difference threshold according to the size of the installation package to be downloaded.
[0080] The difference threshold may be positively correlated with the size of the installation package. That is, the larger the installation package, the larger the difference threshold, and the smaller the installation package, the smaller the difference threshold. The size of the installation package may refer to the size of the storage space required by the installation package.
[0081] Since the difference threshold is positively correlated with the size of the installation package, when the installation package is large, the difference threshold is also large. That is, the mobile terminal will update its download interface again only when the current download amount has changed significantly compared to the historical download amount when the download interface was last updated. This can avoid the first thread frequently sending interface update instructions to the second thread, and further avoid high resource usage of the mobile terminal in the process of obtaining the installation package.
[0082] In an embodiment of the present application, after the mobile terminal sends a request to obtain the installation package to the application server, it can receive a message sent by the application server, in which the data included in the installation package is encapsulated. The message may include a message header, and the message header also carries the size of the installation package. After the mobile terminal receives the message, the first thread of the mobile terminal can parse the message header and then determine the size of the installation package.
[0083] Afterwards, the first thread may determine the difference threshold corresponding to the currently acquired installation package based on the size of the installation package and the pre-stored ratio threshold. The difference threshold may be equal to the product of the size of the installation package and the ratio threshold.
[0084] It should be noted that if the difference threshold determined by the first thread based on the size of the installation package and the ratio threshold is less than 0.01M, the first thread may determine 0.01M as the difference threshold. If the difference threshold determined by the first thread based on the size of the installation package and the ratio threshold is greater than 1.5M, the first thread may determine 1.5M as the difference threshold.
[0085] Step 202: During the process of downloading the installation package, the first thread determines the current download amount of the installation package.
[0086] In the embodiment of the present application, the first thread can cyclically perform the following operations during the process of downloading the installation package: write the data of the unit download amount of the installation package to the local of the mobile terminal; calculate the download amount of the installation package currently written to the local. That is, the first thread can write the data included in the installation package to the local of the mobile terminal in multiple times, and can write the data of the unit download amount to the local of the mobile terminal each time. And, after the first thread downloads the data of the unit download amount each time, it can calculate the download amount of the installation package currently written to the local, that is, the current download amount of the installation package.
[0087] For example, each time the first thread writes the unit download amount data of the installation package to the local of the mobile terminal, it can determine the sum of the download amount previously written to the local and the download amount written to the local this time, and determine the sum as the download amount of the installation package currently written to the local.
[0088] Optionally, the unit download amount may be pre-stored in the mobile terminal, for example, the unit download amount may be 4096 bytes (byte, B).
[0089] For example, assuming that the unit download size is 4096B, and the download size previously written to the local mobile terminal is 57.81M, the current download size of the installation package determined by the first thread is 57.814M.
[0090] Step 203: The first thread detects whether the current download amount is greater than the download amount threshold.
[0091] In the embodiment of the present application, after determining the current download amount, the first thread may compare the current download amount with the download amount threshold. If it is determined that the current download amount is greater than the download amount threshold, step 204 may be executed. If it is determined that the current download amount is not greater than the download amount threshold, the previous difference threshold may be kept unchanged, and step 205 may be executed.
[0092] The download volume threshold may be determined according to the size of the installation package, for example, 50% of the size of the installation package.
[0093] For example, assuming that the size of the installation package is 126.8M, the download amount threshold is 50% of the size of the installation package 126.8M, that is, 63.4M, and the current download amount of the installation package determined by the first thread is 57.814M. Since 57.814M is less than 63.4M, the first thread can determine that the current download amount is not greater than the download amount threshold, and then the previous difference threshold can be kept unchanged, and step 205 is executed.
[0094] Assume that the current download size of the installation package determined by the first thread is 65.09M. Since 65.09M is greater than 63.4M, the first thread can determine that the current download size of the installation package is greater than the download size threshold, and then step 204 can be executed.
[0095] Step 204: Increase or decrease the difference threshold.
[0096] After determining that the current download amount is greater than the download amount threshold, the first thread can increase or decrease the difference threshold. For example, after determining that the current download amount is greater than the download amount threshold, the first thread can increase the difference threshold, thereby reducing the update frequency of the download interface of the mobile terminal, thereby reducing the resource occupation of the mobile terminal. Alternatively, after determining that the current download amount is greater than the download amount threshold, the first thread can reduce the difference threshold, thereby making the data changes of the download progress displayed on the download interface more detailed.
[0097] Optionally, the adjustment step size (ie, the increasing step size or the decreasing step size) of the difference threshold may be smaller than the difference threshold, for example, may be 50% of the difference threshold.
[0098] Since the first thread can increase or decrease the difference threshold, that is, the difference threshold is adjustable, the download interface can be updated according to different progress, thereby improving the update flexibility of the download interface.
[0099] It should be noted that in the embodiment of the present application, there may be one or more download volume thresholds, and the multiple download volume thresholds may be incremental. For example, the multiple download volume thresholds may be three download volume thresholds, and the three download volume thresholds may be respectively: 30% of the size of the installation package, 50% of the size of the installation package, and 80% of the size of the installation package. That is, the download process of the installation package can be divided into different download stages, and each download stage corresponds to a different download volume interval. Accordingly, for each download stage, the difference threshold can be increased or decreased based on the difference threshold of the previous download stage, thereby further improving the flexibility of the download interface update.
[0100] Optionally, as the current download amount continues to increase, the difference threshold may change in a pattern of first increasing and then decreasing. This ensures that during the initial download of the installation package and at the end of the download of the installation package, the download progress data displayed on the download interface changes more minutely, thereby improving the user experience.
[0101] For example, assuming that the size of the installation package is X, the mobile terminal stores three download thresholds, namely: 0.3X (i.e., 30% of the size of the installation package), 0.5X (i.e., 50% of the size of the installation package), and 0.8X (i.e., 80% of the size of the installation package). That is, the download process of the installation package is divided into four different download stages, and the download amount intervals corresponding to the four different download stages are: [0, 0.3X], (0.3X, 0.5X], (0.5X, 0.8X] and (0.8X, X], respectively.
[0102] Assume that the difference threshold of the download volume interval [0, 0.3X] is 0.1M, and the difference threshold first increases and then decreases based on the difference threshold of the previous download stage, and the adjustment step is 0.05M. Then when the current download volume of the installation package is greater than 0.3X, that is, the download volume interval is (0.3X, 0.5X], the first thread can increase the difference threshold to 0.15M. When the current download volume of the installation package is greater than 0.5X, that is, the download volume interval is (0.5X, 0.8X], the first thread can reduce the difference threshold to 0.1M. When the current download volume of the installation package is greater than 0.8X, that is, the download volume interval is (0.8X, X], the first thread can reduce the difference threshold to 0.05M.
[0103] Step 205: The first thread detects whether the difference between the current download amount and the historical download amount is greater than or equal to a difference threshold.
[0104] The historical download amount may be the download amount of the installation package when the download interface was last updated.
[0105] If the first thread detects that the difference between the current download amount and the historical download amount is greater than or equal to the difference threshold, step 206 may be executed. If the first thread detects that the difference between the current download amount and the historical download amount is less than the difference threshold, the installation package may continue to be downloaded and step 202 may be executed.
[0106] For example, assuming that the difference threshold is 1.26M, the historical download amount is 57.81M, and the current download amount of the installation package determined by the first thread is 59.08M, the first thread can determine that the difference between the current download amount and the historical download amount is 1.27M, which is greater than the difference threshold 1.26M. The first thread can then send an interface update instruction to the second thread.
[0107] Assuming that the current download size of the installation package determined by the first thread is 57.814M, the first thread can determine that the difference between the current download size and the historical download size is 0.004M, which is less than the difference threshold of 1.26M. The first thread can then continue to download the installation package and execute step 202.
[0108] Step 206: The first thread sends an interface update instruction to the second thread.
[0109] In an embodiment of the present application, if the first thread determines that the difference between the current download amount and the historical download amount of the installation package is greater than or equal to the difference threshold, an interface update instruction can be sent to the second thread, and the interface update instruction can carry the current download amount of the installation package so that the second thread can update the download interface.
[0110] Optionally, the operating system of the mobile terminal may be an Android operating system, and accordingly, the first thread may send an interface update instruction to the second thread through a handler, wherein the handler is an asynchronous message processing mechanism applicable to the Android operating system, and is used to encapsulate the interface update instruction sent by the first thread, and send the encapsulated interface update instruction to the second thread.
[0111] Step 207: The second thread responds to the interface update instruction and updates the download interface according to the current download amount.
[0112] After receiving the interface update instruction sent by the first thread, the second thread of the mobile terminal may update the download interface of the mobile terminal based on the current download amount of the installation package carried in the interface update instruction.
[0113] Optionally, the download interface may display a progress bar, a percentage of download progress, and a ratio of the current download amount to the size of the installation package. The second thread may respond to the interface update instruction to update the progress bar in the download interface, the percentage of download progress, and the ratio of the current download amount to the size of the installation package.
[0114] For example, Figure 4 A schematic diagram showing a download interface of a mobile terminal is shown in FIG. Figure 4 The download interface may include a progress bar 01 and the words "Downloading...". Figure 4 It can be seen that the size of the installation package is 126.8M. After the previous update of the download interface, the historical download volume of the installation package was 57.81M, and the download percentage was 45%.
[0115] Assuming that the current download size of the installation package carried in the interface update instruction sent by the first thread to the second thread is 59.08M, the second thread can respond to the interface update instruction by updating 57.81M in the download interface to 59.08M and updating the download progress percentage of 45% to 46%, which is the ratio of 59.08M to 126.8M.
[0116] Step 208: The first thread uses the current download amount to update the historical download amount.
[0117] In the embodiment of the present application, after detecting that the difference between the current download amount and the historical download amount is greater than or equal to the difference threshold, the first thread may also use the current download amount of the installation package to update the historical download amount, so as to update the historical download amount to the current download amount. The mobile terminal may then continue to execute step 202, thereby ensuring the accuracy of the current download amount and the historical download amount subsequently determined by the first thread.
[0118] For example, assuming that after the download interface was last updated, the historical download amount of the installation package was 57.81M, and the current download amount of the installation package was 59.08M, the first thread may update the historical download amount of the installation package to 59.08M.
[0119] In the related technology, each time the first thread writes a unit download amount of data to the local of the mobile terminal, it can send an interface update instruction to the second thread, resulting in the first thread sending 3 to 4 interface update instructions to the second thread within 1 millisecond (ms). On the one hand, it causes a high resource usage of the mobile terminal. On the other hand, since the unit download amount is small, the download amount between two adjacent times changes little or even does not change, resulting in invalid updates to the download interface.
[0120] By using the method provided in the embodiment of the present application to update the download interface, the first thread can send an interface update instruction to the second thread at a relatively long interval (eg, 500 ms), which can effectively save resources of the mobile terminal and ensure effective update of the download interface.
[0121] It should be noted that each time the mobile terminal writes the unit download amount data of the installation package to the local of the mobile terminal, the above steps 202 to 208 can be executed until the installation package is downloaded. That is, the mobile terminal can cyclically execute the above steps 202 to 208 until the installation package is downloaded.
[0122] It should also be noted that the order of the steps of the download interface update method for the mobile terminal provided in the embodiment of the present application can be adjusted appropriately, and the steps can also be increased or decreased accordingly according to the situation. For example, steps 201 and 202 can be executed synchronously, steps 207 and 208 can also be executed synchronously, and steps 203 and 204 can be deleted according to the situation, that is, there is no need to adjust the difference threshold. Any technician familiar with the technical field can easily think of a method of change within the technical scope disclosed in this application, which should be covered within the scope of protection of this application, so it will not be repeated.
[0123] In summary, the embodiment of the present application provides a method for updating the download interface of a mobile terminal, wherein the mobile terminal can determine a difference threshold based on the size of the installation package to be downloaded, and can update the download interface based on the current download amount when it is detected that the difference between the current download amount and the historical download amount of the installation package is greater than or equal to the difference threshold. Since the difference threshold is positively correlated with the size of the installation package, and the mobile terminal updates the download interface only when the difference between the current download amount and the historical download amount of the installation package is greater than or equal to the difference threshold, that is, when the current download amount of the mobile terminal has a significant change compared to the historical download amount after the previous update, rather than periodically updating the download interface according to a fixed update cycle, invalid updates of the download interface can be avoided.
[0124] Furthermore, since the mobile terminal updates the download interface when it detects that the difference between the current download amount and the historical download amount of the installation package is greater than or equal to the difference threshold, it can avoid the first thread frequently sending interface update instructions to the second thread, thereby reducing resource usage when the mobile terminal obtains the download package.
[0125] Figure 5 1 is a flow chart of a method for updating a download interface of a mobile terminal provided in an embodiment of the present application. The method can be applied to a mobile terminal, for example Figure 1 The mobile terminal 110 is shown. Figure 5 , the method may include:
[0126] Step 301: During the process of downloading an installation package, determine a first ratio of a current download amount of the installation package to a size of the installation package.
[0127] The size of the installation package may refer to the size of the storage space required by the installation package.
[0128] Step 302: If it is detected that the difference between the first ratio and the second ratio is greater than or equal to the ratio threshold, the download interface of the mobile terminal is updated according to the current download amount.
[0129] The second ratio is a ratio of a historical download amount of the installation package to a size of the installation package, wherein the historical download amount is a download amount of the installation package when the mobile terminal last updated the download interface.
[0130] After determining the difference between the first ratio and the second ratio, the mobile terminal may compare the difference with the ratio threshold. If the mobile terminal determines that the difference is greater than or equal to the ratio threshold, the download interface may be updated according to the current download amount.
[0131] In summary, the embodiment of the present application provides a method for updating the download interface of a mobile terminal, wherein the mobile terminal can determine a first ratio of the current download amount of an installation package to the size of the installation package, and can update the download interface of the mobile terminal according to the current download amount when it is detected that the difference between the first ratio and the second ratio is greater than or equal to the ratio threshold. Since the mobile terminal updates the download interface only when it detects that the difference between the first ratio and the second ratio is greater than or equal to the ratio threshold, that is, when the current download amount of the mobile terminal has a significant change compared to the historical download amount after the last update, instead of periodically updating the download interface according to a fixed update cycle, invalid updates of the download interface can be avoided.
[0132] Figure 6 1 is a flow chart of another method for updating the download interface of a mobile terminal provided in an embodiment of the present application. The method can be applied to a mobile terminal, for example Figure 1 The mobile terminal 110 shown in FIG. 1 may include a first thread and a second thread running in the mobile terminal 110. Figure 6 , the method may include:
[0133] Step 401: The first thread determines a ratio threshold according to the size of the installation package to be downloaded.
[0134] In an embodiment of the present application, a correspondence between the size range of the installation package and the ratio threshold is pre-stored in the mobile terminal. After determining the size of the installation package to be downloaded, the first thread can determine the corresponding ratio threshold according to the range of the size of the installation package. Among them, the ratio threshold recorded in the corresponding relationship is negatively correlated with the size of the installation package. That is, the larger the installation package, the smaller the ratio threshold, and the smaller the installation package, the larger the ratio threshold. For example, if the size of the installation package is 10 gigabytes (G) to 15G, the ratio threshold can be 0.0001. If the size of the installation package is 100M to 200M, the ratio threshold can be 0.005 or 0.01.
[0135] Since the ratio threshold of the ratio threshold is negatively correlated with the size of the installation package, it can be ensured that the difference between the download progress displayed each time the mobile terminal updates the download interface and the download progress displayed when the download interface was last updated is small, that is, it can be ensured that the download progress will not have a large jump. The size of the installation package may refer to the size of the storage space required for the installation package.
[0136] In an embodiment of the present application, the process of determining the size of the installation package by the first thread may include: after the mobile terminal sends a request to obtain the installation package to the application server, it may receive a message sent by the application server, in which the data included in the installation package is encapsulated. The message may include a message header, and the message header also carries the size of the installation package. After the mobile terminal receives the message, the first thread of the mobile terminal may parse the message header and then determine the size of the installation package.
[0137] Step 402: During the process of downloading the installation package, the first thread determines the current download amount of the installation package.
[0138] The process of the first thread determining the current download amount of the installation package may refer to the implementation process of the above step 202, which will not be described in detail in the embodiment of the present application.
[0139] Step 403: The first thread detects whether the current download amount is greater than a download amount threshold.
[0140] If the first thread determines that the current download amount is greater than the download amount threshold, step 404 may be executed. If it is determined that the current download amount is not greater than the download amount threshold, the previous ratio threshold may be kept unchanged, and step 405 may be executed.
[0141] The implementation process of step 403 may refer to the implementation process of step 203 above, and the embodiment of the present application will not be repeated here.
[0142] Step 404: The first thread increases or decreases the ratio threshold.
[0143] If the first thread detects that the current download amount is greater than the download amount threshold, the ratio threshold may be increased or decreased, that is, the ratio threshold is adjustable.
[0144] Optionally, when adjusting the ratio threshold, the adjustment step (ie, the increase step or the decrease step) may be smaller than the ratio threshold, for example, may be 50% of the ratio threshold.
[0145] It should be noted that, in the embodiment of the present application, there may be one or more download volume thresholds, and the multiple download volume thresholds may be incremental. For example, the multiple download volume thresholds may be three download volume thresholds, and the three download volume thresholds may be respectively: 30% of the size of the installation package, 50% of the size of the installation package, and 80% of the size of the installation package. That is, the download process of the installation package can be divided into different download stages, and each download stage corresponds to a different download volume interval. Accordingly, for each download stage, the ratio threshold can be increased or decreased based on the ratio threshold of the previous download stage, thereby further improving the flexibility of the download interface update.
[0146] Optionally, as the current download amount continues to increase, the ratio threshold may change in a pattern of first increasing and then decreasing. This ensures that during the start of downloading the installation package and the end of downloading the installation package, the download progress data displayed on the download interface changes more minutely, thereby improving the user experience.
[0147] For example, assuming that the size of the installation package is X, the mobile terminal stores three download thresholds, namely: 0.3X (i.e., 30% of the size of the installation package), 0.5X (i.e., 50% of the size of the installation package), and 0.8X (i.e., 80% of the size of the installation package). That is, the download process of the installation package is divided into four different download stages, and the download amount intervals corresponding to the four different download stages are: [0, 0.3X], (0.3X, 0.5X], (0.5X, 0.8X] and (0.8X, X], respectively.
[0148] Assume that the ratio threshold of the download volume interval [0, 0.3X] is 0.01, and the ratio threshold first increases and then decreases based on the ratio threshold of the previous download stage, and the adjustment step is 0.005. Then when the current download volume of the installation package is greater than 0.3X, that is, the download volume interval is (0.3X, 0.5X], the first thread can increase the ratio threshold to 0.015. When the current download volume of the installation package is greater than 0.5X, that is, the download volume interval is (0.5X, 0.8X], the first thread can reduce the ratio threshold to 0.01. When the current download volume of the installation package is greater than 0.8X, that is, the download volume interval is (0.8X, X], the first thread can reduce the ratio threshold to 0.005.
[0149] Step 405: The first thread determines a first ratio of the current download amount of the installation package to the size of the installation package.
[0150] After determining the current download amount of the installation package, the first thread may determine a first ratio of the current download amount of the installation package to the size of the installation package.
[0151] Step 406: The first thread determines a second ratio of the historical download amount to the size of the installation package.
[0152] The historical download volume is the download volume of the installation package when the download interface was last updated.
[0153] In an embodiment of the present application, the first thread only needs to determine the second ratio of the current historical download amount to the size of the installation package after each interface update, without having to determine the second ratio of the historical download amount to the size of the installation package after each determination of the current download amount, thereby reducing the computational complexity of the first thread.
[0154] Step 407: The first thread detects whether the difference between the first ratio and the second ratio is greater than or equal to a ratio threshold.
[0155] After determining the first ratio and the second ratio, the first thread may determine the difference between the first ratio and the second ratio, and compare the difference with the ratio threshold. If the first thread determines that the difference is greater than or equal to the ratio threshold, step 408 may be executed. If the first thread determines that the difference is less than the ratio threshold, the installation package may continue to be downloaded, and step 402 may be executed.
[0156] For example, assuming that the size of the installation package is 126.8M, the ratio threshold is 0.01, the historical download amount is 57.81M, and the current download amount is 57.814M, the first thread can determine that the first ratio of the current download amount to the size of the installation package is: 57.814M / 126.8M=0.455, and the second ratio of the historical download amount to the size of the installation package is: 57.81M / 126.8M=0.455. Therefore, it can be determined that the difference between the first ratio and the second ratio is 0, which is less than 0.01, and step 402 can be executed.
[0157] Assuming that the current download amount is 59.08M, the first thread can determine that the first ratio of the current download amount to the size of the installation package is: 59.08M / 126.8M=0.466. Therefore, it can be determined that the difference between the first ratio and the second ratio is 0.011, which is greater than 0.01, so step 408 can be executed.
[0158] Step 408: The first thread sends an interface update instruction to the second thread.
[0159] Step 409: The second thread responds to the interface update instruction and updates the download interface according to the current download amount.
[0160] Step 410: The first thread uses the current download amount to update the historical download amount.
[0161] The implementation process of the above steps 408 to 410 can refer to the implementation process of the above steps 206 to 208, and the embodiment of the present application will not be repeated here.
[0162] It should be noted that the order of the steps of the download interface update method for the mobile terminal provided in the embodiment of the present application can be appropriately adjusted, and the steps can also be increased or decreased accordingly according to the situation. For example, steps 405 and 406 can be executed synchronously, steps 409 and 410 can also be executed synchronously, and steps 403 and 404 can be deleted according to the situation, that is, there is no need to adjust the ratio threshold. Any technician familiar with the technical field can easily think of a method of change within the technical scope disclosed in this application, which should be covered within the scope of protection of this application, so it will not be repeated.
[0163] In summary, the embodiment of the present application provides a method for updating the download interface of a mobile terminal, wherein the mobile terminal can determine a first ratio of the current download amount of an installation package to the size of the installation package, and can update the download interface of the mobile terminal according to the current download amount when it is detected that the difference between the first ratio and the second ratio is greater than or equal to the ratio threshold. Since the mobile terminal updates the download interface only when it detects that the difference between the first ratio and the second ratio is greater than or equal to the ratio threshold, that is, when the current download amount of the mobile terminal has a significant change compared to the historical download amount after the last update, instead of periodically updating the download interface according to a fixed update cycle, invalid updates of the download interface can be avoided.
[0164] Furthermore, since the mobile terminal updates the download interface when it detects that the difference between the first ratio and the second ratio is greater than or equal to the ratio threshold, it can avoid the first thread frequently sending interface update instructions to the second thread, thereby reducing resource usage when the mobile terminal obtains the download package.
[0165] Figure 7 : is a flowchart of another method for updating the download interface of a mobile terminal provided in an embodiment of the present application. The method can be applied to a mobile terminal, which can be Figure 1 The mobile terminal 110 is shown. Figure 7 , the method may include:
[0166] Step 501: Determine a number threshold according to the size of the installation package to be downloaded.
[0167] The number threshold is positively correlated with the size of the installation package. That is, the larger the installation package, the larger the number threshold, and the smaller the installation package, the smaller the number. The size of the installation package may refer to the size of the storage space required by the installation package.
[0168] Since the number threshold is positively correlated with the size of the installation package, when the installation package is large, the number threshold is also large. That is, the mobile terminal will update its download interface again only when the current download amount has changed significantly compared to the historical download amount when the download interface was last updated. This can avoid the first thread frequently sending interface update instructions to the second thread, and further avoid high resource usage of the mobile terminal in the process of obtaining the installation package.
[0169] Step 502: During the process of downloading the installation package, determine the current data write count of the installation package.
[0170] In the embodiment of the present application, the first thread can cyclically perform the following operations during the process of downloading the installation package: writing the data of the unit download amount of the installation package to the storage space of the mobile terminal (e.g., the local storage of the mobile terminal); counting the current data write times, that is, the cumulative number of times the data of the installation package is currently written to the local storage. That is, each time the first thread writes the data of the unit download amount of the installation package to the local storage of the mobile terminal, the current data write times of the installation package can be determined. Among them, the amount of data written to the storage space each time is the unit download amount.
[0171] Step 503: If it is detected that the difference between the current data writing times and the historical data writing times is greater than or equal to the times threshold, the download interface of the mobile terminal is updated according to the current download amount of the installation package.
[0172] In the embodiment of the present application, after determining the current data write count of the installation package, the mobile terminal can determine the difference between the current data write count and the historical data write count, and compare the difference with the number of times threshold. If it is determined that the difference is greater than the number of times threshold, the mobile terminal can update the download interface of the mobile terminal according to the current download amount of the installation package.
[0173] The number of historical data write times is the number of data write times of the installation package when the download interface was last updated, and the current download amount of the installation package can be determined based on the unit download amount of the installation package and the current number of data write times.
[0174] In summary, the embodiment of the present application provides a method for updating the download interface of a mobile terminal, in which the mobile terminal can determine a times threshold based on the size of the installation package to be downloaded, and can update the download interface based on the current download amount of the installation package when it is detected that the difference between the current data write times and the historical data write times of the installation package is greater than the times threshold. Since the times threshold is positively correlated with the size of the installation package, and the mobile terminal updates the download interface only when the difference between the current data write times and the historical data write times of the installation package is greater than the times threshold, that is, when the current download amount of the mobile terminal has a significant change compared to the historical download amount after the previous update, rather than periodically updating the download interface according to a fixed update cycle, invalid updates of the download interface can be avoided.
[0175] Figure 8 : is a flowchart of another method for updating the download interface of a mobile terminal provided in an embodiment of the present application. The method can be applied to a mobile terminal, which can be Figure 1 The mobile terminal 110 shown in FIG. 1 is a mobile terminal 110. In addition, the mobile terminal runs a first thread and a second thread, see Figure 8 , the method may include:
[0176] Step 601: According to the size of the installation package to be downloaded, the first thread determines a number threshold.
[0177] In an embodiment of the present application, the number threshold is positively correlated with the size of the installation package. The number threshold is positively correlated with the size of the installation package. That is, the larger the installation package, the larger the number threshold, and the smaller the installation package, the smaller the number. The size of the installation package may refer to the size of the storage space required for the installation package.
[0178] Optionally, the first thread may determine the number threshold by the ratio of the product of the size of the installation package and the ratio threshold (ie, the difference threshold mentioned above) to the unit download amount. The unit download amount may be pre-stored in the mobile terminal, for example, 4096B.
[0179] Since the number threshold is positively correlated with the size of the installation package, when the installation package is large, the number threshold is also large. That is, the mobile terminal will update its download interface again only when the current download amount has changed significantly compared to the historical download amount when the download interface was last updated. This can avoid the first thread frequently sending interface update instructions to the second thread, and further avoid high resource usage of the mobile terminal in the process of obtaining the installation package.
[0180] Step 602: During the process of downloading the installation package, the first thread determines the current data write count of the installation package.
[0181] In the embodiment of the present application, the first thread can cyclically perform the following operations during the process of downloading the installation package: writing the data of the unit download amount of the installation package to the storage space of the mobile terminal (e.g., the local storage of the mobile terminal); counting the current data write times, that is, the cumulative number of times the data of the installation package is currently written to the local storage. That is, each time the first thread writes the data of the unit download amount of the installation package to the local storage of the mobile terminal, the current data write times of the installation package can be determined. Among them, the amount of data written to the storage space each time is the unit download amount.
[0182] Step 603: The first thread determines the current download amount of the installation package based on the current number of data writes.
[0183] After counting the current data writing times each time, the first thread may also calculate the download amount of the installation package currently written into the local mobile terminal based on the current data writing times, that is, the current download amount of the installation package.
[0184] Optionally, the first thread may determine the product of the unit download amount of the installation package and the current number of data writes as the current download amount of the installation package.
[0185] For example, assuming that the unit download size is 4096B, and the current data write count of the installation package determined by the first thread is 15121, the first thread may determine that the current data write count of the installation package is 59.08M.
[0186] Step 604: The first thread detects whether the current download amount is greater than a download amount threshold.
[0187] If the first thread determines that the current download amount is greater than the download amount threshold, step 605 may be executed. If it is determined that the current download amount is not greater than the download amount threshold, the previous number threshold may be kept unchanged, and step 602 may be executed.
[0188] The implementation process of step 604 may refer to the implementation process of step 203 above, and the embodiment of the present application will not be repeated here.
[0189] Step 605: The first thread increases or decreases the number threshold.
[0190] If the first thread determines that the current download amount of the installation package is greater than the download amount threshold, the number threshold may be increased or decreased, that is, the number threshold is adjustable.
[0191] Optionally, the adjustment step size of the number threshold (ie, the increasing step size or the decreasing step size) may be smaller than the number threshold, for example, may be 50% of the number threshold.
[0192] It should be noted that in the embodiment of the present application, there may be one or more download volume thresholds, and the multiple download volume thresholds may be incremental. For example, the multiple download volume thresholds may be three download volume thresholds, and the three download volume thresholds may be respectively: 30% of the size of the installation package, 50% of the size of the installation package, and 80% of the size of the installation package. That is, the download process of the installation package can be divided into different download stages, and each download stage corresponds to a different download volume interval. Accordingly, for each download stage, the number threshold can be increased or decreased based on the number threshold of the previous download stage, thereby further improving the flexibility of the download interface update.
[0193] Optionally, as the current download amount continues to increase, the change pattern of the number threshold may be: first increase and then decrease. This ensures that during the initial download of the installation package and at the end of the download of the installation package, the download progress data displayed on the download interface changes more meticulously, thereby improving the user experience.
[0194] For example, assuming that the size of the installation package is X, the mobile terminal stores three download thresholds, namely: 0.3X (i.e., 30% of the size of the installation package), 0.5X (i.e., 50% of the size of the installation package), and 0.8X (i.e., 80% of the size of the installation package). That is, the download process of the installation package is divided into four different download stages, and the download amount intervals corresponding to the four different download stages are: [0, 0.3X], (0.3X, 0.5X], (0.5X, 0.8X] and (0.8X, X], respectively.
[0195] Assume that the number threshold of the download volume interval [0, 0.3X] is 322, and the number threshold first increases and then decreases based on the number threshold of the previous download stage, and the adjustment step is 161. Then when the current download volume of the installation package is greater than 0.3X, that is, the download volume interval is (0.3X, 0.5X], the first thread can increase the number threshold to 483. When the current download volume of the installation package is greater than 0.5X, that is, the download volume interval is (0.5X, 0.8X], the first thread can reduce the number threshold to 322. When the current download volume of the installation package is greater than 0.8X, that is, the download volume interval is (0.8X, X], the first thread can reduce the number threshold to 161.
[0196] Step 606: The first thread detects whether the difference between the current data writing times and the historical data writing times is greater than or equal to a times threshold.
[0197] The number of historical data writes may be the number of data writes to the installation package when the download interface was last updated.
[0198] If the first thread determines that the difference between the current data write times and the historical data write times is greater than or equal to the times threshold, step 607 may be executed. If the first thread determines that the difference between the current data write times and the historical data write times is less than the times threshold, the installation package may continue to be downloaded and step 602 may be executed.
[0199] For example, assuming that the number threshold is 322, the number of historical data writes is 14799, and the current data write number determined by the first thread is 14799, the first thread can determine that the difference between the current data write number and the historical data write number is 0, which is less than the number threshold 322, so step 602 can be executed.
[0200] Assuming that the current number of data writes is 15121, the first thread may determine that the difference between the current number of data writes and the historical number of data writes is 322, which is equal to the number threshold 322, and therefore step 607 may be executed.
[0201] Step 607: The first thread sends an interface update instruction to the second thread.
[0202] Step 608: The second thread responds to the interface update instruction and updates the download interface according to the current download amount.
[0203] The implementation process of the above steps 607 and 608 can refer to the implementation process of the above steps 206 and 207, and the embodiment of the present application will not be repeated here.
[0204] Step 609: The first thread uses the current data writing times to update the historical data writing times.
[0205] In the embodiment of the present application, after detecting that the difference between the current data write count and the historical data write count is greater than the count threshold, the first thread may also use the current data write count of the installation package to update the historical data write count, so as to update the data write count to the current data write count. The mobile terminal may then continue to execute step 602, thereby ensuring the accuracy of the difference between the current data write count and the historical data write count determined by the first thread later.
[0206] For example, assuming that after the download interface was last updated, the number of historical data writes of the installation package was 14799, and the number of current data writes of the installation package was 15121, the first thread may update the number of historical data writes of the installation package to 15121.
[0207] It should be noted that the order of the steps of the download interface update method for the mobile terminal provided in the embodiment of the present application can be adjusted appropriately, and the steps can also be increased or decreased accordingly according to the situation. For example, step 607 and step 608 can be executed simultaneously, and step 604 and step 605 can be deleted according to the situation, that is, there is no need to adjust the number threshold. Any technician familiar with the technical field can easily think of a method of change within the technical scope disclosed in this application, which should be covered within the scope of protection of this application, so it will not be repeated.
[0208] In summary, the embodiment of the present application provides a method for updating the download interface of a mobile terminal, in which the mobile terminal can determine a times threshold based on the size of the installation package to be downloaded, and can update the download interface based on the current download amount of the installation package when it is detected that the difference between the current data write times and the historical data write times of the installation package is greater than the times threshold. Since the times threshold is positively correlated with the size of the installation package, and the mobile terminal updates the download interface only when the difference between the current data write times and the historical data write times of the installation package is greater than the times threshold, that is, when the current download amount of the mobile terminal has a significant change compared to the historical download amount after the previous update, rather than periodically updating the download interface according to a fixed update cycle, invalid updates of the download interface can be avoided.
[0209] Furthermore, since the mobile terminal updates the download interface when it detects that the difference between the current data write count and the historical data write count of the installation package is greater than the count threshold, it can avoid the first thread frequently sending interface update instructions to the second thread, thereby reducing resource usage when the mobile terminal obtains the download package.
[0210] Fig. 9 Schematic diagram of a mobile terminal provided by an embodiment of the present application. Fig. 9 As shown, the mobile terminal may include a processor 1101 and a display screen 131. The processor 1101 may be used for:
[0211] During the process of downloading the installation package, determining a first ratio of a current download amount of the installation package to a size of the installation package;
[0212] If it is detected that the difference between the first ratio and the second ratio is greater than or equal to the ratio threshold, updating the download interface of the mobile terminal according to the current download amount;
[0213] The second ratio is a ratio of a historical download amount of the installation package to a size of the installation package, wherein the historical download amount is a download amount of the installation package when the download interface was last updated.
[0214] The display screen is used to display the download interface.
[0215] Optionally, a first thread and a second thread are running in the processor 1101;
[0216] The first thread is used to determine a first ratio of a current download amount of the installation package to a size of the installation package during the process of downloading the installation package; if it is detected that the difference between the first ratio and the second ratio is greater than or equal to a ratio threshold, send an interface update instruction to the second thread;
[0217] The second thread is used to respond to the interface update instruction and update the download interface according to the current download amount.
[0218] Optionally, the processor 1101 may also be used for:
[0219] Update the historical download quantity with the current download quantity.
[0220] In summary, the embodiment of the present application provides a method for updating the download interface of a mobile terminal, wherein the mobile terminal can determine a first ratio of the current download amount of an installation package to the size of the installation package, and can update the download interface of the mobile terminal according to the current download amount when it is detected that the difference between the first ratio and the second ratio is greater than or equal to the ratio threshold. Since the mobile terminal updates the download interface only when it detects that the difference between the first ratio and the second ratio is greater than or equal to the ratio threshold, that is, when the current download amount of the mobile terminal has a significant change compared to the historical download amount after the last update, instead of periodically updating the download interface according to a fixed update cycle, invalid updates of the download interface can be avoided.
[0221] like Fig. 9 The mobile terminal shown, the processor 1101 included in the mobile terminal 110, can also be used for:
[0222] Determine a difference threshold value according to the size of the installation package to be downloaded, where the difference threshold value is positively correlated with the size of the installation package;
[0223] During the process of downloading the installation package, determining the current download amount of the installation package;
[0224] If it is detected that the difference between the current download amount and the historical download amount is greater than or equal to the difference threshold, the download interface of the mobile terminal is updated according to the current download amount;
[0225] Among them, the historical download volume is the download volume of the installation package when the download interface was last updated.
[0226] The display screen 131 is used to display a download interface.
[0227] Optionally, the processor 1101 is configured to:
[0228] The product of the size of the installation package and the ratio threshold is determined as the difference threshold.
[0229] Optionally, the processor 1101 is further configured to:
[0230] Update the historical download quantity with the current download quantity.
[0231] In summary, the embodiment of the present application provides a mobile terminal, which can determine a difference threshold based on the size of the installation package to be downloaded, and can update the download interface based on the current download amount when it is detected that the difference between the current download amount and the historical download amount of the installation package is greater than or equal to the difference threshold. Since the difference threshold is positively correlated with the size of the installation package, and the mobile terminal updates the download interface only when the difference between the current download amount and the historical download amount of the installation package is greater than or equal to the difference threshold, that is, when the current download amount of the mobile terminal has a significant change compared to the historical download amount after the previous update, instead of periodically updating the download interface according to a fixed update cycle, invalid updates of the download interface can be avoided.
[0232] like Fig. 9 The mobile terminal 110 shown, the processor 1101 included in the mobile terminal 110, can also be used for:
[0233] According to the size of the installation package to be downloaded, a number threshold is determined, and the number threshold is positively correlated with the size of the installation package;
[0234] During the process of downloading the installation package, determining the current data write count of the installation package;
[0235] If it is detected that the difference between the current data writing times and the historical data writing times is greater than or equal to the times threshold, the download interface of the mobile terminal is updated according to the current download amount of the installation package;
[0236] The historical data writing times is the data writing times of the installation package when the download interface was last updated, and the current download amount is determined based on the unit download amount of the installation package and the current data writing times.
[0237] The display screen 131 is used to display a download interface.
[0238] Optionally, the processor 1101 is further configured to:
[0239] The current data writing times are used to update the historical data writing times.
[0240] In summary, the embodiment of the present application provides a method for updating the download interface of a mobile terminal, in which the mobile terminal can determine a times threshold based on the size of the installation package to be downloaded, and can update the download interface based on the current download amount of the installation package when it is detected that the difference between the current data write times and the historical data write times of the installation package is greater than the times threshold. Since the times threshold is positively correlated with the size of the installation package, and the mobile terminal updates the download interface only when the difference between the current data write times and the historical data write times of the installation package is greater than the times threshold, that is, when the current download amount of the mobile terminal has a significant change compared to the historical download amount after the previous update, rather than periodically updating the download interface according to a fixed update cycle, invalid updates of the download interface can be avoided.
[0241] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the mobile terminal and each device described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0242] like Fig. 9 As shown, the mobile terminal 110 may further include: a display unit 130, a memory 140, a radio frequency (RF) circuit 150, an audio circuit 160, a wireless fidelity (Wi-Fi) module 170, a Bluetooth module 180, a power supply 190, a camera 121 and a processor 1101 and other components.
[0243] Among them, the camera 121 can be used to capture static pictures or videos. The object generates an optical picture through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the processor 1101 to convert it into a digital picture signal.
[0244] The processor 1101 is the control center of the mobile terminal 110. It uses various interfaces and lines to connect various parts of the entire terminal. It executes various functions of the mobile terminal 110 and processes data by running or executing software programs stored in the memory 140 and calling data stored in the memory 140. In some embodiments, the processor 1101 may include one or more processing units; the processor 1101 may also integrate an application processor and a baseband processor, wherein the application processor mainly processes an operating system, a user interface, and an application program, and the baseband processor mainly processes wireless communication. It is understandable that the above-mentioned baseband processor may not be integrated into the processor 1101. In the present application, the processor 1101 can run an operating system and an application program, can control the display of a user interface, and can implement the download interface update method of the mobile terminal described in the embodiment of the present application. In addition, the processor 1101 is coupled to the input unit and the display unit 130.
[0245] The display unit 130 may be used to receive input digital or character information, generate signal input related to user settings and function control of the mobile terminal 110, and optionally, the display unit 130 may also be used to display information input by the user or information provided to the user and a graphical user interface (GUI) of various menus of the mobile terminal 110. The display unit 130 may include a display screen 131 disposed on the front of the mobile terminal 110. The display screen 131 may be configured in the form of a liquid crystal display, a light emitting diode, etc. The display unit 130 may be used to display various graphical user interfaces described in this application.
[0246] The display unit 130 includes: a display screen 131 and a touch screen 132 disposed on the front of the mobile terminal 110. The display screen 131 can be used to display preview images. The touch screen 132 can collect user touch operations on or near it, such as clicking a button, dragging a scroll box, etc. Among them, the touch screen 132 can be covered on the display screen 131, and the touch screen 132 can also be integrated with the display screen 131 to realize the input and output functions of the mobile terminal 110. After integration, it can be simply called a touch display screen.
[0247] The memory 140 can be used to store software programs and data. The processor 1101 executes various functions and data processing of the mobile terminal 110 by running the software programs or data stored in the memory 140. The memory 140 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. The memory 140 stores an operating system that enables the mobile terminal 110 to run. In the present application, the memory 140 can store an operating system and various application programs, and can also store code for executing the download interface update method of the mobile terminal described in the embodiment of the present application.
[0248] The RF circuit 150 can be used to receive and send signals during the process of sending and receiving information or making calls. It can receive downlink data from the base station and hand it over to the processor 1101 for processing; it can send uplink data to the base station. Generally, the RF circuit includes but is not limited to antennas, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer and other devices.
[0249] The audio circuit 160, the speaker 161, and the microphone 162 can provide an audio interface between the user and the mobile terminal 110. The audio circuit 160 can transmit the electrical signal converted from the received audio data to the speaker 161, which is converted into a sound signal for output. The mobile terminal 110 can also be configured with a volume button for adjusting the volume of the sound signal. On the other hand, the microphone 162 converts the collected sound signal into an electrical signal, which is received by the audio circuit 160 and converted into audio data, and then the audio data is output to the RF circuit 150 to be sent to, for example, another terminal, or the audio data is output to the memory 140 for further processing. In this application, the microphone 162 can obtain the user's voice.
[0250] Wi-Fi is a short-range wireless transmission technology. The mobile terminal 110 can help users send and receive emails, browse web pages, and access streaming media through the Wi-Fi module 170, which provides users with wireless broadband Internet access.
[0251] The Bluetooth module 180 is used to exchange information with other Bluetooth devices having Bluetooth modules through the Bluetooth protocol. For example, the mobile terminal 110 can establish a Bluetooth connection with a wearable electronic device (such as a smart watch) that also has a Bluetooth module through the Bluetooth module 180 to exchange data.
[0252] The mobile terminal 110 also includes a power supply 190 (such as a battery) for supplying power to various components. The power supply can be logically connected to the processor 1101 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption. The mobile terminal 110 can also be configured with a power button for turning on and off the terminal, as well as locking the screen and other functions.
[0253] The mobile terminal 110 may include at least one sensor 1110, such as a motion sensor 11101, a distance sensor 11102, a fingerprint sensor 11103, and a temperature sensor 11104. The mobile terminal 110 may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor.
[0254] Fig.10 : is a software structure diagram of a mobile terminal provided in an embodiment of the present application. The layered architecture divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer.
[0255] The application layer can include a series of application packages. Fig.10 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc. The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0256] like Fig.10 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0257] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0258] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, pictures, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0259] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0260] The phone manager is used to provide communication functions of the mobile terminal 110, such as management of call status (including connection, disconnection, etc.).
[0261] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0262] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt tone is emitted, the communication terminal vibrates, and the indicator light flashes.
[0263] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0264] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0265] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0266] The system library may include multiple functional modules, such as surface manager, media libraries, 3D graphics processing library (such as openGL ES), 2D graphics engine (such as SGL), etc.
[0267] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0268] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0269] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing.
[0270] A 2D graphics engine is a drawing engine for 2D drawings.
[0271] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0272] The embodiment of the present application provides a computer-readable storage medium, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the download interface update method for a mobile terminal provided in the above embodiment, for example Figure 2 , Figure 3 as well as Figures 5 to 8 Any of the methods shown.
[0273] The present application also provides a computer program product including instructions. When the computer program product is run on a computer, the computer executes the download interface update method for a mobile terminal provided in the above method embodiment. For example, Figure 2 , Figure 3 as well as Figures 5 to 8 Any of the methods shown.
[0274] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0275] The above description is only an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A mobile terminal, characterized in that: The mobile terminal includes a processor and a display screen; the processor is used to: In the process of downloading the installation package, determining a first ratio of the current download amount of the installation package to the size of the installation package; when the current download amount falls into any download amount interval of a plurality of download amount intervals, increasing or decreasing a ratio threshold used in a previous download amount interval to obtain an adjusted ratio threshold, wherein the plurality of download amount intervals are obtained by dividing according to the plurality of download amount thresholds; If it is detected that the difference between the first ratio and the second ratio is greater than or equal to the adjusted ratio threshold, the download interface of the mobile terminal is updated according to the current download amount; if it is detected that the difference between the first ratio and the second ratio is less than the adjusted ratio threshold, the download interface of the mobile terminal is not updated; The information displayed in the updated download interface can indicate the current download amount; The second ratio is a ratio of the historical download volume of the installation package to the size of the installation package, and the historical download volume is the download volume of the installation package when the download interface was last updated; The display screen is used to display the download interface.
2. The mobile terminal according to claim 1, characterized in that: A first thread and a second thread are running in the processor; The first thread is used to determine a first ratio of a current download amount of the installation package to a size of the installation package during downloading of the installation package; If it is detected that the difference between the first ratio and the second ratio is greater than or equal to the ratio threshold, sending an interface update instruction to the second thread; The second thread is used to respond to the interface update instruction and update the download interface according to the current download amount.
3. The mobile terminal according to claim 1 or 2, characterized in that: The processor is used to: The ratio threshold is determined according to the size of the installation package, and the ratio threshold is negatively correlated with the size of the installation package.
4. A mobile terminal, characterized in that: The mobile terminal includes a processor and a display screen; the processor is used to: Determining a difference threshold according to the size of the installation package to be downloaded, wherein the difference threshold is positively correlated with the size of the installation package; In the process of downloading the installation package, determine the current download amount of the installation package; when the current download amount falls into any download amount interval of multiple download amount intervals, increase or decrease the difference threshold used in the previous download amount interval to obtain an adjusted difference threshold, wherein the multiple download amount intervals are obtained according to the multiple download amount thresholds; If it is detected that the difference between the current download amount and the historical download amount is greater than or equal to the adjusted difference threshold, the download interface of the mobile terminal is updated according to the current download amount; if it is detected that the difference between the current download amount and the historical download amount is less than the adjusted difference threshold, the download interface of the mobile terminal is not updated; the information displayed in the updated download interface can indicate the current download amount; The historical download volume is the download volume of the installation package when the download interface was last updated; The display screen is used to display the download interface.
5. The mobile terminal according to claim 4, characterized in that: A first thread and a second thread are running in the processor; The first thread is used to determine the current download amount of the installation package during the process of downloading the installation package; if it is detected that the difference between the current download amount and the historical download amount is greater than or equal to the difference threshold, send an interface update instruction to the second thread; The second thread is used to respond to the interface update instruction and update the download interface according to the current download amount.
6. The mobile terminal according to claim 4 or 5, characterized in that: The processor is used to: The product of the size of the installation package and the ratio threshold is determined as the difference threshold.
7. A mobile terminal, characterized in that: The mobile terminal includes a processor and a display screen; the processor is used to: Determine a number threshold according to the size of the installation package to be downloaded, where the number threshold is positively correlated with the size of the installation package; During the process of downloading the installation package, determining the current data write count of the installation package, the current data write count being the cumulative number of times the data of the installation package is currently written to the storage space of the mobile terminal, wherein the amount of data written to the storage space each time is the unit download amount; If it is detected that the difference between the current data writing times and the historical data writing times is greater than or equal to the times threshold, updating the download interface of the mobile terminal according to the current download amount of the installation package; The historical data writing times is the data writing times of the installation package when the download interface was last updated, and the current download amount is determined based on the unit download amount and the current data writing times; The display screen is used to display the download interface.
8. A method for updating a download interface of a mobile terminal, characterized in that: The method comprises: In the process of downloading the installation package, determining a first ratio of the current download amount of the installation package to the size of the installation package; when the current download amount falls into any download amount interval of a plurality of download amount intervals, increasing or decreasing a ratio threshold used in a previous download amount interval to obtain an adjusted ratio threshold, wherein the plurality of download amount intervals are obtained by dividing according to the plurality of download amount thresholds; If it is detected that the difference between the first ratio and the second ratio is greater than or equal to the adjusted ratio threshold, the download interface of the mobile terminal is updated according to the current download amount; if it is detected that the difference between the first ratio and the second ratio is less than the adjusted ratio threshold, the download interface of the mobile terminal is not updated; updating the download interface includes: updating the historical download amount in the download interface to the current download amount; The second ratio is a ratio of the historical download volume of the installation package to the size of the installation package, and the historical download volume is the download volume of the installation package when the download interface was last updated.
9. A method for updating a download interface of a mobile terminal, characterized in that: The method comprises: Determining a difference threshold according to the size of the installation package to be downloaded, wherein the difference threshold is positively correlated with the size of the installation package; In the process of downloading the installation package, determine the current download amount of the installation package; when the current download amount falls into any download amount interval of multiple download amount intervals, increase or decrease the difference threshold used in the previous download amount interval to obtain an adjusted difference threshold, wherein the multiple download amount intervals are obtained according to the multiple download amount thresholds; If it is detected that the difference between the current download amount and the historical download amount is greater than or equal to the adjusted difference threshold, the download interface is updated according to the current download amount; if it is detected that the difference between the current download amount and the historical download amount is less than the adjusted difference threshold, the download interface of the mobile terminal is not updated; the information displayed in the updated download interface can indicate the current download amount; The historical download volume is the download volume of the installation package when the download interface was last updated.
10. A method for updating a download interface of a mobile terminal, characterized in that: The method comprises: Determine a number threshold according to the size of the installation package to be downloaded, where the number threshold is positively correlated with the size of the installation package; During the process of downloading the installation package, determining the current data write count of the installation package, the current data write count being the cumulative number of times the data of the installation package is currently written to the storage space of the mobile terminal, wherein the amount of data written to the storage space each time is the unit download amount; If it is detected that the difference between the current data writing times and the historical data writing times is greater than or equal to the times threshold, updating the download interface of the mobile terminal according to the current download amount of the installation package; The historical data writing times is the data writing times of the installation package when the download interface was last updated, and the current download amount is determined based on the unit download amount and the current data writing times.
Citation Information
Patent Citations
Progress bar control method and device
CN104244100A