Download progress refreshing method and device, medium and electronic equipment
By obtaining the current instantaneous network speed and historical network speed information, dynamically adjusting the download progress refresh frequency, the problem of untimely refreshing the download progress or excessive performance consumption in the existing technology is solved, and the effect of taking into account both user experience and performance is achieved.
Patent Information
- Application Number
- CN202311287610.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-07
- Publication Date
- 2025-04-08
AI Technical Summary
In the current technology, it is difficult to take into account both user experience and performance when refreshing the download progress, especially when the network environment is unstable, the refresh is not timely or the performance consumes too much.
By obtaining the current instantaneous network speed and historical network speed information, dynamically adaptively adjust the refresh frequency of the download progress. Reduce the refresh frequency when the network speed is slow to avoid performance losses; increase the refresh frequency when the network speed is fast to ensure that users are aware of progress in a timely manner.
It realizes that the download progress refresh frequency is adjusted in a timely manner under different network speed conditions, which not only maintains a good user experience, but also avoids unnecessary performance losses.
Smart Images

Figure CN119788743A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular, to a download progress refresh method, device, medium and electronic device. Background Art
[0002] In current terminal applications, for the download of resource files such as videos, audios, and pictures, data is usually transmitted in the form of byte streams. In this process, in order to facilitate users to perceive the execution of download behavior, the download progress is usually displayed in real time on the download interface. At present, there are mainly two ways to refresh the download progress, one is to refresh the download progress at a fixed time interval, and the other is to refresh the download progress according to a fixed data block volume. However, due to the complex network environment and the existence of many unstable factors, the above two methods may have problems such as untimely refresh and performance consumption, and neither can give a good balance between user experience and performance. Summary of the invention
[0003] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0004] In a first aspect, the present disclosure provides a download progress refreshing method, comprising:
[0005] Get the current instantaneous network speed and historical network speed information;
[0006] Determine the current refresh frequency of the download progress according to the current instantaneous network speed and the historical network speed information;
[0007] Refresh the download progress according to the current refresh frequency.
[0008] In a second aspect, the present disclosure provides a download progress refreshing device, comprising:
[0009] The acquisition module is used to obtain the current instantaneous network speed and historical network speed information;
[0010] A determination module, used to determine the current refresh frequency of the download progress according to the current instantaneous network speed and the historical network speed information;
[0011] A refresh module is used to refresh the download progress according to the current refresh frequency.
[0012] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the download progress refresh method provided in the first aspect of the present disclosure.
[0013] In a fourth aspect, the present disclosure provides an electronic device, including:
[0014] a storage device having a computer program stored thereon;
[0015] A processing device is used to execute the computer program in the storage device to implement the steps of the download progress refresh method provided in the first aspect of the present disclosure.
[0016] In the above technical solution, the current refresh frequency of the download progress is determined based on the current instantaneous network speed. In this way, the refresh frequency of the download progress can be dynamically and adaptively adjusted according to the actual network speed, so that the refresh frequency can be appropriately reduced when the network speed is slow, which not only maintains a good user experience but also avoids unnecessary performance loss. When the network speed is fast, the refresh frequency is appropriately increased, which is convenient for users to understand the real-time progress in time, and the performance loss can be controlled not to be too large, thereby achieving the effect of taking into account both performance and user experience. In addition, when determining the current refresh frequency of the download progress, not only the current instantaneous network speed is referred to, but also the historical network speed information is combined, thereby avoiding the problem of sudden changes in the refresh frequency caused by unstable instantaneous network speed, and ensuring a smooth transition of the refresh frequency of the download progress. In addition, the above download progress refresh scheme is suitable for downloading files of various types and sizes, and has a wide range of applicability.
[0017] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings:
[0019] Figure 1 The figure is a flowchart of a download progress refreshing method according to an exemplary embodiment.
[0020] Figure 2 The present invention is a flowchart showing a method for determining a current refresh frequency of a download progress according to current instantaneous network speed and historical network speed information according to an exemplary embodiment.
[0021] Figure 3 The figure is a block diagram showing a download progress refreshing device according to an exemplary embodiment.
[0022] Figure 4 The diagram is a schematic structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0023] As discussed in the background technology, currently, the download progress is mainly refreshed in two ways: fixed time interval or fixed data block size. However, due to the complex network environment and many unstable factors, the above two methods may have problems such as untimely refresh and performance consumption, and both cannot give a good balance between user experience and performance.
[0024] Specifically, the download progress is refreshed at fixed time intervals, that is, the download progress is refreshed every fixed time (for example, 50 milliseconds). This method is simple to implement, but it cannot adapt to rapidly changing network speeds. For example, when the network speed is very slow, frequent download progress updates may cause unnecessary drawing of the download interface, causing unnecessary performance loss; when the network speed is very fast, the download progress may not be displayed in time, and the user experience is not good.
[0025] Refresh the download progress according to the fixed data block size, that is, set the download progress to refresh once every download of a certain size of data block (such as every 10KB). However, when the network speed is slow, the download progress refresh frequency is low, and the user may need to wait a long time to see the download progress refresh; while in an environment with a good network speed, the download progress refresh frequency may be too frequent, resulting in a large performance loss and may cause application freezes.
[0026] It can be seen that both of the above two methods cannot give a good balance between user experience and performance. In view of this, the present disclosure provides a download progress refresh method, device, medium and electronic device.
[0027] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0028] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0029] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0030] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0031] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0032] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0033] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0034] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0035] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0036] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0037] At the same time, it is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0038] Figure 1 FIG. 1 is a flow chart showing a download progress refresh method according to an exemplary embodiment. Figure 1 As shown, the download progress refreshing method may include S11 to S13.
[0039] In S11, the current instantaneous network speed and historical network speed information are obtained.
[0040] In the present disclosure, the above download progress refreshing method can be applied to terminal devices such as smart phones, tablet computers, laptops, desktop computers, etc.
[0041] During the download process of the current download task, the download amount within the preset time period (for example, 50 milliseconds) is calculated once every preset time period as the current instantaneous network speed. The historical network speed information may include the average network speed of each historical period in at least one historical period before the current period during the execution of the current download task. Among them, the current period is the period in which the current moment is located, the start time of the current period is the end time of the period before the current period, and the end time of the current period is the current moment; the duration of the current period and each historical period is the above-mentioned preset duration. The average network speed of a historical period is the average value of the network speed within the historical period.
[0042] In S12, the current refresh frequency of the download progress is determined according to the current instantaneous network speed and the historical network speed information.
[0043] In S13, the download progress is refreshed according to the current refresh frequency.
[0044] In the present disclosure, the download progress of the current download task can be displayed through a progress bar in the download interface, and information such as the current download amount, current download completion degree, and estimated download completion time can be displayed on the progress bar.
[0045] In the above technical solution, the current refresh frequency of the download progress is determined based on the current instantaneous network speed. In this way, the refresh frequency of the download progress can be dynamically and adaptively adjusted according to the actual network speed, so that the refresh frequency can be appropriately reduced when the network speed is slow, which not only maintains a good user experience but also avoids unnecessary performance loss. When the network speed is fast, the refresh frequency is appropriately increased, which is convenient for users to understand the real-time progress in time, and the performance loss can be controlled not to be too large, thereby achieving the effect of taking into account both performance and user experience. In addition, when determining the current refresh frequency of the download progress, not only the current instantaneous network speed is referred to, but also the historical network speed information is combined, thereby avoiding the problem of sudden changes in the refresh frequency caused by unstable instantaneous network speed, and ensuring a smooth transition of the refresh frequency of the download progress. In addition, the above download progress refresh scheme is suitable for downloading files of various types and sizes, and has a wide range of applicability.
[0046] The following is a detailed description of the specific implementation method of determining the current refresh frequency of the download progress according to the current instantaneous network speed and the historical network speed information in S12. Figure 2 It is implemented by S121 and S122 shown in FIG.
[0047] In S121, the current average network speed is determined based on the current instantaneous network speed and historical network speed information.
[0048] In the present disclosure, the current average network speed is the average network speed in the current time period, that is, the average value of the network speed in the current time period.
[0049] In S122, the current refresh frequency of the download progress is determined according to the current average network speed.
[0050] In the above implementation, the current average network speed is determined based on the current instantaneous network speed and the historical network speed information, so that an accurate assessment of the current average network speed can be achieved, and then a refresh frequency matching the actual network speed can be obtained, so that the refresh of the download progress can efficiently adapt to network fluctuations.
[0051] The following is a detailed description of the specific implementation method for determining the current average network speed according to the current instantaneous network speed and the historical network speed information in S121. In the present disclosure, it can be implemented through a variety of implementation methods. In one implementation, the historical network speed information may include the average network speed of the previous time period of the current time period. At this time, the current average network speed can be calculated according to the current instantaneous network speed and the average network speed of the previous time period of the current time period through the exponential moving average (EMA) strategy. The EMA strategy is used to calculate the current average network speed, taking into account the network speed conditions during the execution of the current download task and all historical time periods, and accurate evaluation of the current average network speed can be achieved.
[0052] For example, the current average network speed can be calculated based on the current instantaneous network speed and the average network speed of the previous period of the current period through the EMA strategy using the following equation (1):
[0053] S(t) = (size(t) * alpha) + S(t-1) * (1-alpha) (1)
[0054] Among them, S(t) is the exponential moving average at time t (i.e., the tth moment), that is, the average network speed of time period t (i.e., the tth moment); S(t-1) is the exponential moving average at time (t-1), that is, the average network speed of time period (t-1), time (t-1) is the moment before time t, the starting time of time period t is the ending time of time period t-1, that is, time (t-1), and the ending time of time period t is time t; size(t) is the download amount from time (t-1) to time t, that is, the instantaneous network speed at time t; alpha is the smoothing factor, and its value range is (0,1); S(0) = 0.
[0055] Preferably, the smoothing factor alpha is less than 0.5, for example, 0.1. In this way, a higher weight can be given to recent network speed data, which can more accurately reflect the current actual network speed, and then a refresh frequency matching the actual network speed can be obtained, so that the refresh of the download progress can efficiently adapt to network fluctuations.
[0056] In another embodiment, the above-mentioned historical network speed information may include the average network speed of each historical period in the most recent N historical periods. At this time, the current instantaneous network speed and the average network speed of each historical period in the most recent N historical periods can be weighted according to the Fibonacci sequence to obtain the current average network speed.
[0057] In the present disclosure, N is determined based on the length of the Fibonacci sequence, and N=the length of the Fibonacci sequence-1. The length of the Fibonacci sequence may be a first preset length, for example, 5; of course, the length of the Fibonacci sequence may also be a value dynamically adjusted based on the current average network speed, in which case the initial value of the length of the Fibonacci sequence is a second preset length.
[0058] Among them, the Fibonacci sequence is also known as the golden section sequence, and its values are: 1, 1, 2, 3, 5, 8, 13, 21, 34... Mathematically, this sequence is defined by the following recursive method: F(0) = 1, F(1) = 1, F(n) = F(n-1) + F(n-2) (n≥2, n∈N*).
[0059] Specifically, according to the Fibonacci sequence, the current instantaneous network speed and the average network speed of each historical period in the last N historical periods can be weighted in the following way to obtain the current average network speed:
[0060] First, using each item of the Fibonacci sequence as a weight, calculate the weighted average of the current instantaneous network speed and the average network speed of each historical period; then, determine the weighted average as the current average network speed.
[0061] At this time, using each item of the Fibonacci sequence as the weight, the weighted average of the current instantaneous network speed and the average network speed of each historical period can be calculated by the following equation (2):
[0062]
[0063] For example, the length of the Fibonacci sequence is 5, that is, the Fibonacci sequence is 1, 1, 2, 3, 5, N = 4, then:
[0064]
[0065] In addition, after the current average network speed is determined each time, the length of the Fibonacci sequence can be dynamically adjusted based on the current average network speed. Specifically, the above download progress refresh method can also include the following steps:
[0066] If the current average network speed is greater than the preset network speed threshold, the length of the Fibonacci sequence is increased; if the current average network speed is less than the preset network speed threshold, the length of the Fibonacci sequence is reduced; if the current average network speed is equal to the preset network speed threshold, the length of the Fibonacci sequence remains unchanged.
[0067] When the current average network speed is greater than the preset network speed threshold, the length of the Fibonacci sequence can be increased, for example, the third preset length (for example, 2) can be increased, so that the impact of the historical network speed on the current average network speed in the next calculation can be increased, thereby avoiding performance loss caused by too frequent refresh frequency of the download progress. When the current average network speed is less than the preset network speed threshold, the length of the Fibonacci sequence can be reduced, for example, the fourth preset length (for example, 1) can be reduced, so that the impact of the historical network speed on the current average network speed in the next calculation can be reduced, thereby avoiding the problem of untimely update of the download progress caused by too low refresh frequency of the download progress.
[0068] In another embodiment, the historical network speed information may include the average network speed of each historical period in the most recent M historical periods, or the average network speed of each historical period during the execution of the current download task, where M≥1. In this case, the current average network speed may be calculated using a simple moving average (SMA) strategy based on the current instantaneous network speed and the average network speed of each historical period.
[0069] Specifically, when the above historical network speed information includes the average network speed of each historical period in the most recent M historical periods, the current average network speed can be calculated through the SMA strategy based on the current instantaneous network speed and the average network speed of each historical period in the most recent M historical periods. When the above historical network speed information includes the average network speed of each historical period during the execution of the current download task, the current average network speed can be calculated through the SMA strategy based on the current instantaneous network speed and the average network speed of each historical period during the execution of the current download task.
[0070] For example, the current average network speed can be calculated according to the current instantaneous network speed and the average network speed of each historical period in the most recent M historical periods through the SMA strategy using the following equation (3):
[0071]
[0072] As another example, the current average network speed can be calculated using the following equation (4) based on the current instantaneous network speed and the average network speed of each historical period during the execution of the current download task:
[0073]
[0074] The specific implementation method of determining the current refresh frequency of the download progress according to the current average network speed in the above S122 is described in detail below.
[0075] Specifically, according to the pre-established correspondence between the network speed range and the refresh frequency, the refresh frequency corresponding to the network speed range where the current average network speed is located is determined as the current refresh frequency of the download progress.
[0076] In the present disclosure, in the correspondence between the network speed interval and the refresh frequency, the upper limit of the network speed interval is positively correlated with the refresh frequency, that is, the larger the upper limit of the network speed interval, the higher the corresponding refresh frequency, that is, the current average network speed is positively correlated with the current refresh frequency. In this way, the refresh frequency can be appropriately reduced when the network speed is slow, which not only maintains a good user experience but also avoids unnecessary performance loss. When the network speed is fast, the refresh frequency can be appropriately increased, which is convenient for users to understand the real-time progress in time, and the performance loss can be controlled not to be too large, thereby achieving the effect of taking into account both performance and user experience.
[0077] When the current download task starts, the download progress refreshing method is executed once every the preset time period until the current download task is completed.
[0078] Figure 3 FIG. 1 is a block diagram of a download progress refresh device according to an exemplary embodiment. Figure 3 As shown, the download progress refreshing device 300 includes:
[0079] The acquisition module 301 is used to obtain the current instantaneous network speed and historical network speed information;
[0080] A determination module 302, configured to determine a current refresh frequency of the download progress according to the current instantaneous network speed and the historical network speed information;
[0081] The refresh module 303 is used to refresh the download progress according to the current refresh frequency.
[0082] In the above technical solution, the current refresh frequency of the download progress is determined based on the current instantaneous network speed. In this way, the refresh frequency of the download progress can be dynamically and adaptively adjusted according to the actual network speed, so that the refresh frequency can be appropriately reduced when the network speed is slow, which not only maintains a good user experience but also avoids unnecessary performance loss. When the network speed is fast, the refresh frequency is appropriately increased, which is convenient for users to understand the real-time progress in time, and the performance loss can be controlled not to be too large, thereby achieving the effect of taking into account both performance and user experience. In addition, when determining the current refresh frequency of the download progress, not only the current instantaneous network speed is referred to, but also the historical network speed information is combined, thereby avoiding the problem of sudden changes in the refresh frequency caused by unstable instantaneous network speed, and ensuring a smooth transition of the refresh frequency of the download progress. In addition, the above download progress refresh scheme is suitable for downloading files of various types and sizes, and has a wide range of applicability.
[0083] Optionally, the determining module 302 includes:
[0084] A first determination submodule, configured to determine a current average network speed according to the current instantaneous network speed and the historical network speed information;
[0085] The second determination submodule is used to determine the current refresh frequency of the download progress according to the current average network speed.
[0086] Optionally, the historical network speed information includes an average network speed in a time period before the current time period;
[0087] The first determination submodule is used to calculate the current average network speed through an exponential moving average strategy according to the current instantaneous network speed and the average network speed in the previous period.
[0088] Optionally, the smoothing factor of the exponential moving average strategy is less than 0.5.
[0089] Optionally, the historical network speed information includes an average network speed of each of the most recent N historical time periods;
[0090] The first determination submodule is used to perform weighted operation on the current instantaneous network speed and the average network speed of each historical time period according to the Fibonacci sequence to obtain the current average network speed, wherein N is determined based on the length of the Fibonacci sequence.
[0091] Optionally, the first determining submodule includes:
[0092] A calculation submodule, for calculating a weighted average of the current instantaneous network speed and the average network speed of each historical period, using each item of the Fibonacci sequence as a weight;
[0093] The third determining submodule is used to determine the weighted average value as the current average network speed.
[0094] Optionally, the device 300 further includes:
[0095] A first adjustment module, configured to increase the length if the current average network speed is greater than a preset network speed threshold;
[0096] The second adjustment module is used to reduce the length if the current average network speed is less than the preset network speed threshold.
[0097] Optionally, the historical network speed information includes the average network speed of each of the most recent M historical time periods, or the average network speed of each historical time period during the execution of the current download task, where M≥1,
[0098] The first determination submodule is used to calculate the current average network speed through a simple moving average strategy according to the current instantaneous network speed and the average network speed of each historical time period.
[0099] Optionally, the second determination submodule is used to determine the refresh frequency corresponding to the network speed range in which the current average network speed is located according to a pre-established correspondence between the network speed range and the refresh frequency, as the current refresh frequency of the download progress, wherein in the correspondence, the upper limit value of the network speed range is positively correlated with the refresh frequency.
[0100] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0101] The present disclosure also provides a computer-readable medium on which a computer program is stored. When the program is executed by a processing device, the steps of the above-mentioned download progress refreshing method provided by the present disclosure are implemented.
[0102] Reference below Figure 4 , which shows a schematic diagram of the structure of an electronic device (e.g., a terminal device) 600 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0103] like Figure 4As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0104] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0105] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0106] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0107] In some embodiments, the client can communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0108] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0109] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: obtains the current instantaneous network speed and historical network speed information; determines the current refresh frequency of the download progress based on the current instantaneous network speed and the historical network speed information; and refreshes the download progress according to the current refresh frequency.
[0110] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0111] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0112] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a module does not limit the module itself in some cases. For example, an acquisition module may also be described as a "module for acquiring current instantaneous network speed and historical network speed information."
[0113] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0114] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0115] According to one or more embodiments of the present disclosure, Example 1 provides a download progress refreshing method, including:
[0116] Get the current instantaneous network speed and historical network speed information;
[0117] Determine the current refresh frequency of the download progress according to the current instantaneous network speed and the historical network speed information;
[0118] Refresh the download progress according to the current refresh frequency.
[0119] According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, wherein determining the current refresh frequency of the download progress according to the current instantaneous network speed and the historical network speed information includes:
[0120] Determine the current average network speed according to the current instantaneous network speed and the historical network speed information;
[0121] The current refresh frequency of the download progress is determined according to the current average network speed.
[0122] According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 2, wherein the historical network speed information includes an average network speed of a time period before the current time period;
[0123] The determining the current average network speed according to the current instantaneous network speed and the historical network speed information includes:
[0124] The current average network speed is calculated based on the current instantaneous network speed and the average network speed in the previous period using an exponential moving average strategy.
[0125] According to one or more embodiments of the present disclosure, Example 4 provides the method of Example 3, wherein the smoothing factor of the exponential moving average strategy is less than 0.5.
[0126] According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 2, wherein the historical network speed information includes an average network speed of each of the most recent N historical time periods;
[0127] The determining the current average network speed according to the current instantaneous network speed and the historical network speed information includes:
[0128] According to the Fibonacci sequence, a weighted operation is performed on the current instantaneous network speed and the average network speed of each of the historical time periods to obtain the current average network speed, wherein N is determined based on the length of the Fibonacci sequence.
[0129] According to one or more embodiments of the present disclosure, Example 6 provides the method of Example 5, wherein, according to the Fibonacci sequence, weighting operation is performed on the current instantaneous network speed and the average network speed of each historical period to obtain the current average network speed, including:
[0130] Using each item of the Fibonacci sequence as a weight, calculate a weighted average of the current instantaneous network speed and the average network speed of each of the historical time periods;
[0131] The weighted average value is determined as the current average network speed.
[0132] According to one or more embodiments of the present disclosure, Example 7 provides the method of Example 5, wherein the method further includes:
[0133] If the current average network speed is greater than a preset network speed threshold, increasing the length;
[0134] If the current average network speed is less than the preset network speed threshold, the length is reduced.
[0135] According to one or more embodiments of the present disclosure, Example 8 provides the method of Example 2, wherein the historical network speed information includes the average network speed of each of the most recent M historical time periods, or the average network speed of each historical time period during the execution of the current download task, wherein M≥1,
[0136] The determining the current average network speed according to the current instantaneous network speed and the historical network speed information includes:
[0137] The current average network speed is calculated based on the current instantaneous network speed and the average network speed of each historical period using a simple moving average strategy.
[0138] According to one or more embodiments of the present disclosure, Example 9 provides the method described in any one of Examples 2-8, wherein determining the current refresh frequency of the download progress according to the current average network speed includes:
[0139] According to the pre-established correspondence between the network speed range and the refresh frequency, the refresh frequency corresponding to the network speed range in which the current average network speed is located is determined as the current refresh frequency of the download progress, wherein in the correspondence, the upper limit value of the network speed range is positively correlated with the refresh frequency.
[0140] According to one or more embodiments of the present disclosure, Example 10 provides a download progress refreshing device, including:
[0141] The acquisition module is used to obtain the current instantaneous network speed and historical network speed information;
[0142] A determination module, used to determine the current refresh frequency of the download progress according to the current instantaneous network speed and the historical network speed information;
[0143] A refresh module is used to refresh the download progress according to the current refresh frequency.
[0144] According to one or more embodiments of the present disclosure, Example 11 provides a computer-readable medium having a computer program stored thereon, which implements the steps of any of the methods described in Examples 1-9 when executed by a processing device.
[0145] According to one or more embodiments of the present disclosure, Example 12 provides an electronic device, including:
[0146] a storage device having a computer program stored thereon;
[0147] A processing device is used to execute the computer program in the storage device to implement the steps of the method described in any one of Examples 1-9.
[0148] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0149] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0150] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Claims
1. A download progress refreshing method, characterized in that: include: Get the current instantaneous network speed and historical network speed information; Determine the current refresh frequency of the download progress according to the current instantaneous network speed and the historical network speed information; Refresh the download progress according to the current refresh frequency.
2. The method according to claim 1, characterized in that The determining the current refresh frequency of the download progress according to the current instantaneous network speed and the historical network speed information includes: Determine the current average network speed according to the current instantaneous network speed and the historical network speed information; The current refresh frequency of the download progress is determined according to the current average network speed.
3. The method according to claim 2, characterized in that The historical network speed information includes the average network speed of the previous period of the current period; The determining the current average network speed according to the current instantaneous network speed and the historical network speed information includes: The current average network speed is calculated based on the current instantaneous network speed and the average network speed in the previous period using an exponential moving average strategy.
4. The method according to claim 3, characterized in that The exponential moving average strategy has a smoothing factor of less than 0.
5.
5. The method according to claim 2, characterized in that: The historical network speed information includes the average network speed of each of the most recent N historical time periods; The determining the current average network speed according to the current instantaneous network speed and the historical network speed information includes: According to the Fibonacci sequence, a weighted operation is performed on the current instantaneous network speed and the average network speed of each of the historical time periods to obtain the current average network speed, wherein N is determined based on the length of the Fibonacci sequence.
6. The method according to claim 5, characterized in that The weighting operation is performed on the current instantaneous network speed and the average network speed of each historical period according to the Fibonacci sequence to obtain the current average network speed, including: Using each item of the Fibonacci sequence as a weight, calculate a weighted average of the current instantaneous network speed and the average network speed of each of the historical time periods; The weighted average value is determined as the current average network speed.
7. The method according to claim 5, characterized in that The method further comprises: If the current average network speed is greater than a preset network speed threshold, increasing the length; If the current average network speed is less than the preset network speed threshold, the length is reduced.
8. The method according to claim 2, characterized in that: The historical network speed information includes the average network speed of each of the most recent M historical time periods, or the average network speed of each historical time period during the execution of the current download task, where M≥1, The determining the current average network speed according to the current instantaneous network speed and the historical network speed information includes: The current average network speed is calculated based on the current instantaneous network speed and the average network speed of each historical period using a simple moving average strategy.
9. The method according to any one of claims 2 to 8, characterized in that: Determining the current refresh frequency of the download progress according to the current average network speed includes: According to the pre-established correspondence between the network speed range and the refresh frequency, the refresh frequency corresponding to the network speed range in which the current average network speed is located is determined as the current refresh frequency of the download progress, wherein in the correspondence, the upper limit value of the network speed range is positively correlated with the refresh frequency.
10. A download progress refresh device, characterized in that: include: The acquisition module is used to obtain the current instantaneous network speed and historical network speed information; A determination module, used to determine the current refresh frequency of the download progress according to the current instantaneous network speed and the historical network speed information; A refresh module is used to refresh the download progress according to the current refresh frequency.
11. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processing device, the steps of the method described in any one of claims 1 to 9 are implemented.
12. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 9.