CN104778055B - Method and device for displaying progress bar - Google Patents

Method and device for displaying progress bar Download PDF

Info

Publication number
CN104778055B
CN104778055B CN201410018909.XA CN201410018909A CN104778055B CN 104778055 B CN104778055 B CN 104778055B CN 201410018909 A CN201410018909 A CN 201410018909A CN 104778055 B CN104778055 B CN 104778055B
Authority
CN
China
Prior art keywords
loading
stage
display speed
loading stage
progress bar
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410018909.XA
Other languages
Chinese (zh)
Other versions
CN104778055A (en
Inventor
刘玉磊
豆宁军
李英各
唐廷勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201410018909.XA priority Critical patent/CN104778055B/en
Publication of CN104778055A publication Critical patent/CN104778055A/en
Application granted granted Critical
Publication of CN104778055B publication Critical patent/CN104778055B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a method and a device for displaying a progress bar, and belongs to the technical field of computers. The method comprises the following steps: determining a current loading stage according to the current actual loading condition of resources, wherein each loading stage is preset with different display speeds, the display speed of each loading stage is constant, and the display speed of the next loading stage in the adjacent loading stages is increased progressively compared with the display speed of the previous loading stage; and determining the display speed corresponding to the current loading stage, and displaying the progress bar according to the display speed corresponding to the current loading stage. According to the method, different display speeds are preset for each loading stage, the display speeds of the loading stages are constant and are continuously increased, and after the current loading stage is determined according to the current actual loading condition of resources, the progress bar is displayed at the display speed corresponding to the determined loading stage. Because the display speed corresponding to each loading stage is constant and is continuously increased, the displayed progress bar is smooth and has acceleration feeling.

Description

Method and device for displaying progress bar
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for displaying a progress bar.
Background
With the development of computer network technology, when a terminal loads a page through a browser, in order to enable a user to know the loading condition of resources, a progress bar is usually adopted to display the loading progress when the page is loaded. In order to make the loading progress of the display more consistent with the requirements of the user, how to display the progress bar becomes a key.
In the prior art, when a progress bar is displayed, a loading progress notification is received first, and then the progress bar is displayed according to the received loading progress notification. When the progress bar is displayed according to the received loading progress notification, a plurality of display points of the loading progress can be preset, and when the loading progress reaches the display points, the progress bar is displayed. For example, if the preset display points are 30% and 50% of the loading progress, when the loading progress reaches 30%, displaying 30% of the progress bar; when the loading progress reaches 50%, 50% of the progress bar is displayed.
In the process of implementing the invention, the inventor finds that the prior art has at least the following problems:
in the prior art, when the progress bar is displayed, if the preset display points are 30% and 50% of the loading progress, when the loading progress reaches 30%, 30% of the progress bar is displayed, and when the loading progress reaches 50%, 50% of the progress bar is displayed, so that the display of the progress bar jumps and is not smooth.
Disclosure of Invention
In order to solve the problems of the prior art, embodiments of the present invention provide a method and an apparatus for displaying a progress bar. The technical scheme is as follows:
in a first aspect, a method of displaying a progress bar is provided, the method comprising:
determining a current loading stage according to the current actual loading condition of resources, wherein each loading stage is preset with different display speeds, the display speed of each loading stage is constant, and the display speed of the next loading stage in the adjacent loading stages is increased progressively compared with the display speed of the previous loading stage;
and determining the display speed corresponding to the current loading stage, and displaying a progress bar according to the display speed corresponding to the current loading stage.
With reference to the first aspect, in a first possible implementation manner of the first aspect, the determining a current loading stage according to a current actual loading condition of a resource includes:
if the current actual loading condition of the resource is the loading starting, determining that the current loading stage is the loading starting stage, wherein the display speed corresponding to the loading starting stage is a first display speed;
if the current actual loading condition of the resources is loading start, determining that the current loading stage is a loading proceeding stage, wherein the display speed corresponding to the loading proceeding stage is a second display speed;
if the current actual loading condition of the resource is that the loading progress reaches the preset progress, determining that the current loading stage is a loading sprint stage, and the display speed corresponding to the loading sprint stage is a third display speed;
wherein the first display speed is less than the second display speed, and the second display speed is less than the third display speed.
With reference to the first aspect, in a second possible implementation manner of the first aspect, before the determining the display speed corresponding to the current loading stage, the method further includes:
presetting a display speed corresponding to each loading stage, and storing the corresponding relation between each loading stage and the display speed;
the determining the display speed corresponding to the current loading stage includes:
and inquiring the display speed corresponding to the current loading stage from the corresponding relation between each pre-stored loading stage and the display speed.
With reference to the first aspect, in a third possible implementation manner of the first aspect, after the displaying the progress bar according to the display speed corresponding to the current loading stage, the method further includes:
and if the length of the display progress bar according to the display speed corresponding to the current loading stage exceeds the preset interval length corresponding to the current loading stage and the next loading stage is not entered, displaying the progress bar at a speed smaller than the display speed corresponding to the current loading stage until the first preset length is reached, stopping or entering the next loading stage, and displaying the progress bar according to the display speed corresponding to the next loading stage.
With reference to the first aspect, in a fourth possible implementation manner of the first aspect, after the displaying the progress bar according to the display speed corresponding to the current loading stage, the method further includes:
and if the length of the progress bar displayed according to the display speed corresponding to the current loading stage does not reach the preset interval length corresponding to the current loading stage, entering the next loading stage, and displaying the progress bar according to the display speed corresponding to the next loading stage.
With reference to the first aspect, in a fifth possible implementation manner of the first aspect, the displaying a progress bar according to a display speed corresponding to the current loading stage includes:
and if the current loading stage is the last loading stage, displaying the progress bar in a fading-out mode according to the display speed corresponding to the current loading stage until the preset interval length corresponding to the current loading stage is reached.
With reference to the first aspect or the first to fifth possible implementation manners of the first aspect, in a sixth possible implementation manner of the first aspect, after the displaying of the progress bar is completed, the method further includes:
determining the ideal display speed of each loading stage when the progress bar is displayed according to the preset interval length corresponding to each loading stage when the progress bar is displayed at this time and the time length of the progress bar displayed at each loading stage;
and setting the display speed of each loading stage when the progress bar is displayed next time according to the ideal display speed of each loading stage when the progress bar is displayed this time.
With reference to the first aspect, in a seventh possible implementation manner of the first aspect, the setting, according to the ideal display speed of each loading stage when the progress bar is displayed this time, the display speed of each loading stage when the progress bar is displayed next time includes:
and averaging the ideal display speed of each loading stage when the progress bar is displayed this time and the ideal display speed of each loading stage when the progress bar is displayed for a preset number of times to obtain the average ideal display speed of each loading stage, and setting the display speed of each loading stage when the progress bar is displayed next time according to the average ideal display speed of each loading stage.
In a second aspect, there is provided an apparatus for displaying a progress bar, the apparatus including:
the first determining module is used for determining the current loading stage according to the current actual loading condition of the resource, different display speeds are preset in each loading stage, the display speed of each loading stage is constant, and the display speed of the next loading stage in the adjacent loading stages is increased progressively compared with the display speed of the previous loading stage;
the second determining module is used for determining the display speed corresponding to the current loading stage;
and the first display module is used for displaying the progress bar according to the display speed corresponding to the current loading stage.
With reference to the second aspect, in a first possible implementation manner of the second aspect, the first determining module includes:
the device comprises a first determining unit, a second determining unit and a display unit, wherein the first determining unit is used for determining that a current loading stage is a loading starting stage when the current actual loading condition of resources is starting loading, and the display speed corresponding to the loading starting stage is a first display speed;
a second determining unit, configured to determine that a current loading stage is a loading proceeding stage when a current actual loading condition of the resource is loading start, where a display speed corresponding to the loading proceeding stage is a second display speed;
a third determining unit, configured to determine that the current loading stage is a loading sprint stage when the current actual loading condition of the resource is that the loading progress reaches a preset progress, where a display speed corresponding to the loading sprint stage is a third display speed;
wherein the first display speed is less than the second display speed, and the second display speed is less than the third display speed.
With reference to the second aspect, in a second possible implementation manner of the second aspect, the apparatus further includes:
the first setting module is used for presetting the display speed corresponding to each loading stage;
the storage module is used for storing the corresponding relation between each loading stage and the display speed;
the second determining module is used for inquiring the display speed corresponding to the current loading stage from the pre-stored corresponding relation between each loading stage and the display speed.
With reference to the second aspect, in a third possible implementation manner of the second aspect, the apparatus further includes:
and the second display module is used for displaying the progress bar at a speed smaller than the display speed corresponding to the current loading stage when the length of the progress bar displayed at the display speed corresponding to the current loading stage exceeds the preset interval length corresponding to the current loading stage and the next loading stage is not started, stopping the display or starting the next loading stage until the first preset length is reached, and displaying the progress bar at the display speed corresponding to the next loading stage.
With reference to the second aspect, in a fourth possible implementation manner of the second aspect, the apparatus further includes:
and the third display module is used for displaying the progress bar according to the display speed corresponding to the next loading stage when the length of the progress bar displayed according to the display speed corresponding to the current loading stage does not reach the preset interval length corresponding to the current loading stage and enters the next loading stage.
With reference to the second aspect, in a fifth possible implementation manner of the second aspect, the first display module, when the current loading stage is a last loading stage, is configured to display a progress bar in a fading-out manner according to a display speed corresponding to the current loading stage until a preset interval length corresponding to the current loading stage is reached.
With reference to the second aspect or the first to fifth possible implementation manners of the first aspect, in a sixth possible implementation manner of the second aspect, the apparatus further includes:
the third determining module is used for determining the ideal display speed of each loading stage when the progress bar is displayed according to the preset interval length corresponding to each loading stage when the progress bar is displayed at the time and the time length of the progress bar displayed at each loading stage;
and the second setting module is used for setting the display speed of each loading stage when the progress bar is displayed next time according to the ideal display speed of each loading stage when the progress bar is displayed this time.
With reference to the second aspect, in a seventh possible implementation manner of the second aspect, the second setting module is configured to average the ideal display speeds of the loading stages when the progress bar is displayed this time and the ideal display speeds of the loading stages when the progress bar is displayed for a preset number of times before, to obtain an average ideal display speed of each loading stage, and set the display speed of each loading stage when the progress bar is displayed next time according to the average ideal display speed of each loading stage.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
different display speeds are preset for each loading stage, the display speed of each loading stage is continuously increased, and after the current loading stage is determined according to the current actual loading condition of resources, the progress bar is displayed at the display speed corresponding to the determined loading stage. Because the display speed corresponding to each loading stage is constant and is continuously increased, the displayed progress bar is smooth and has acceleration feeling.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flowchart of a method for displaying a progress bar according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for displaying a progress bar according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a first device for displaying a progress bar according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a first determining module according to a third embodiment of the present invention;
fig. 5 is a schematic structural diagram of a second device for displaying a progress bar according to a third embodiment of the present invention;
fig. 6 is a schematic structural diagram of a third device for displaying a progress bar according to a third embodiment of the present invention;
fig. 7 is a schematic structural diagram of a fourth device for displaying a progress bar according to a third embodiment of the present invention;
fig. 8 is a schematic structural diagram of a fifth device for displaying a progress bar according to a third embodiment of the present invention;
fig. 9 is a schematic structural diagram of a terminal according to a fourth embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Example one
With the development of information technology, resources such as video resources, music resources, web page resources and the like borne on a page are more and more. In order to acquire these resources, the user can load the page by operating the terminal. When a terminal loads a page through a browser, in order to enable a user to know the loading condition of a resource, a progress bar is usually adopted to display the loading progress when the page is loaded. In order to make the displayed loading progress more consistent with the requirements of the user, the embodiment provides a method for displaying a progress bar, which can be applied to displaying a video progress bar in a video scene, displaying a music progress bar in a music scene, displaying a web page progress bar in a web page loading scene, and the like. Referring to fig. 1, the method flow provided by this embodiment includes:
101: determining a current loading stage according to the current actual loading condition of resources, wherein each loading stage is preset with different display speeds, the display speed of each loading stage is constant, and the display speed of the next loading stage in the adjacent loading stages is increased progressively compared with the display speed of the previous loading stage;
102: and determining the display speed corresponding to the current loading stage, and displaying the progress bar according to the display speed corresponding to the current loading stage.
As a preferred embodiment, determining the current loading stage according to the current actual loading condition of the resource includes:
if the current actual loading condition of the resource is the starting loading, determining that the current loading stage is the loading starting stage, and the display speed corresponding to the loading starting stage is the first display speed;
if the current actual loading condition of the resources is loading start, determining that the current loading stage is a loading proceeding stage, and the display speed corresponding to the loading proceeding stage is a second display speed;
if the current actual loading condition of the resource is that the loading progress reaches the preset progress, determining that the current loading stage is a loading sprint stage, and setting the display speed corresponding to the loading sprint stage as a third display speed;
the first display speed is lower than the second display speed, and the second display speed is lower than the third display speed.
As a preferred embodiment, before determining the display speed corresponding to the current loading stage, the method further includes:
presetting a display speed corresponding to each loading stage, and storing the corresponding relation between each loading stage and the display speed;
determining a display speed corresponding to the current loading stage, including:
and inquiring the display speed corresponding to the current loading stage from the corresponding relation between each loading stage and the display speed which are stored in advance.
As a preferred embodiment, after displaying the progress bar according to the display speed corresponding to the current loading stage, the method further includes:
and if the length of the progress bar displayed according to the display speed corresponding to the current loading stage exceeds the preset interval length corresponding to the current loading stage and the next loading stage is not entered, displaying the progress bar at a speed smaller than the display speed corresponding to the current loading stage until the first preset length is reached or entering the next loading stage, and displaying the progress bar according to the display speed corresponding to the next loading stage.
As a preferred embodiment, after displaying the progress bar according to the display speed corresponding to the current loading stage, the method further includes:
and if the length of the progress bar displayed according to the display speed corresponding to the current loading stage does not reach the preset interval length corresponding to the current loading stage, entering the next loading stage, and displaying the progress bar according to the display speed corresponding to the next loading stage.
As a preferred embodiment, if the current loading stage is the last loading stage, displaying the progress bar according to the display speed corresponding to the current loading stage, includes:
and displaying the progress bar in a fading-out mode according to the display speed corresponding to the current loading stage until the preset interval length corresponding to the current loading stage is reached.
As a preferred embodiment, after the displaying of the progress bar is completed, the method further includes:
determining the ideal display speed of each loading stage when the progress bar is displayed according to the preset interval length corresponding to each loading stage when the progress bar is displayed at this time and the time length of the progress bar displayed at each loading stage;
and setting the display speed of each loading stage when the progress bar is displayed next time according to the ideal display speed of each loading stage when the progress bar is displayed this time.
As a preferred embodiment, setting the display speed of each loading stage when the progress bar is displayed next time according to the ideal display speed of each loading stage when the progress bar is displayed this time includes:
and averaging the ideal display speed of each loading stage when the progress bar is displayed this time and the ideal display speed of each loading stage when the progress bar is displayed for a preset number of times to obtain the average ideal display speed of each loading stage, and setting the display speed of each loading stage when the progress bar is displayed next time according to the average ideal display speed of each loading stage.
According to the method provided by the embodiment of the invention, different display speeds are preset for each loading stage, the display speed of each loading stage is constant and continuously increased, and after the current loading stage is determined according to the current actual loading condition of resources, the progress bar is displayed at the display speed corresponding to the determined loading stage. Because the display speed corresponding to each loading stage is constant and is continuously increased, the displayed progress bar is smooth and has acceleration feeling.
Example two
For convenience of understanding, the method for displaying a progress bar provided by the embodiment of the present invention is explained in detail by taking the loaded resource as the web page resource and the displayed progress bar as the web page progress bar as an example, in combination with the content of the first embodiment. Referring to fig. 2, a method flow provided by the embodiment of the present invention includes:
201: the display speed corresponding to each loading stage is preset, the corresponding relation between each loading stage and the display speed is stored, the display speed of each loading stage is constant, and the display speed of the next loading stage in the adjacent loading stages is increased progressively compared with the display speed of the previous loading stage.
For the step, in order to make the displayed progress bar smooth, the method provided by this embodiment divides the loading process of the resource into different loading stages, and sets a corresponding display speed for each loading stage in advance. The loading stage may be specifically divided according to the loading condition of the web resource, including but not limited to, dividing the stage when the web resource is started to be loaded into a start loading stage, dividing the stage when the web resource starts to be loaded into a loading proceeding stage, and dividing the stage when the web resource is loaded to a certain progress into a loading sprint stage, etc. Regarding the method for presetting the display speed corresponding to each loading stage, the embodiment is not particularly limited, and includes but is not limited to providing a setting option, and then setting the corresponding display speed for each loading stage according to the provided setting option.
Regarding the preset size of the display speed corresponding to the loading stage, the embodiment is not particularly limited, and in order to make the display of the progress bar smoother and have more obvious perceptibility, the method provided by the embodiment sets a display speed for each loading stage, where the display speed is constant and is increased progressively in a next loading stage than in a previous loading stage in adjacent loading stages. Presetting the corresponding display speed of the loading stage, including but not limited to setting the corresponding display speed v for starting the loading stage1Setting corresponding display speed v for the loading progress stage2For loading the sprint phaseSetting a corresponding display speed v3,v1<v2<v3And are all at a constant speed. For example, v1Can be 1 cm/sec, 2 cm/sec, 3 cm/sec, etc., v2Can be 2 cm/sec, 3 cm/sec, 4 cm/sec, etc., v3The display speed may be 4 cm/s, 5 cm/s, 6 cm/s, or the like, and the present embodiment does not specifically limit the display speed corresponding to each set loading stage, and can ensure that the display speed corresponding to each loading stage is uniform and continuously increases.
Further, since a corresponding display speed is set for each loading stage in advance, there is a correspondence between each loading stage and the display speed. Specifically, if the corresponding display speed v is set for the start loading stage in advance1Then start the loading phase and display speed v1There is a correspondence between them; if the corresponding display speed v is set for the loading stage in advance2Then the loading progress stage and the display speed v2There is a correspondence between them; if the corresponding display speed v is set for the loading sprint stage in advance3Loading the sprint stage and the display speed v3There is a correspondence between them.
Preferably, since the preset corresponding relationship between each loading stage and the display speed in this step is to be continuously applied when the progress bar is subsequently displayed, the method provided in this embodiment further includes a step of storing the preset corresponding relationship between each loading stage and the display speed after the preset display speed corresponding to each loading stage is preset. The method for storing the corresponding relationship between each loading phase and the display speed is not specifically limited in this embodiment, and includes but is not limited to storing the preset corresponding relationship between each loading phase and the display speed in a corresponding storage medium such as a memory and a flash memory.
It should be noted that, instead of executing step 201 each time the method for displaying the progress bar is implemented, step 201 may be executed when the method for displaying the progress bar is implemented for the first time, and then the method for displaying the progress bar is implemented, the corresponding relationship set in step 201 may be directly used. Of course, when the set corresponding relationship needs to be updated, step 201 may be executed again, and the number of times step 201 is executed is not limited in this embodiment.
202: and determining the current loading stage according to the current actual loading condition of the webpage resources.
For this step, since the current actual loading condition of the web resource may determine the loading stage where the current loading resource is located, in order to determine the current loading stage, the determination may be performed according to the current actual loading condition of the web resource.
Specifically, the current loading stage is determined according to the current actual loading condition of the web page resource, including but not limited to:
if the current actual loading condition of the webpage resources is loading, determining that the current loading stage is a loading starting stage, and the display speed corresponding to the loading starting stage is a first display speed;
if the current actual loading condition of the webpage resources is loading, determining that the current loading stage is a loading proceeding stage, and the display speed corresponding to the loading proceeding stage is a second display speed;
and if the current actual loading condition of the webpage resources is that the loading progress reaches the preset progress, determining that the current loading stage is a loading sprint stage, and setting the display speed corresponding to the loading sprint stage as a third display speed.
The preset schedule may be 80% or 90% of the resource to be loaded, and the preset schedule is not specifically limited in this embodiment, and may be determined according to the resource to be loaded during specific implementation.
After the current loading stage is determined according to the current actual loading condition of the web resource, the method provided by the embodiment displays the web resource at a constant speed by using the display speed corresponding to each loading stage. The progress bar is displayed at the corresponding constant speed in each loading stage, so that the progress bar is displayed smoothly and continuously.
For the above-described processes, a detailed explanation will be given below with a specific example for the sake of understanding.
For example, the preset display speed corresponding to each loading stage is as follows: the display speed corresponding to the starting loading stage is v1The display speed corresponding to the loading progress stage is v2The display speed corresponding to the loading sprint stage is v3Wherein v is1<v2<v3. If the current loading stage is determined to be the starting loading stage according to the current actual loading condition of the webpage resources, adopting v1Displaying a progress bar at a constant speed; if the current loading stage is determined to be the loading proceeding stage according to the current actual loading condition of the webpage resources, adopting v2Displaying a progress bar at a constant speed; if the loading sprint stage is determined to be the loading proceeding stage according to the current actual loading condition of the webpage resource, adopting v3And displaying the progress bar at a constant speed.
203: and determining the display speed corresponding to the current loading stage.
For this step, since the display speed corresponding to each loading stage has been preset in step 201 and the corresponding relationship between each loading stage and the display speed is stored, after the current loading stage is determined, the display speed corresponding to the current loading stage may be queried from the corresponding relationship between each loading stage and the display speed that is stored in advance in this step.
For the above-described processes, a detailed explanation will be given below with a specific example for the sake of understanding.
For example, if the pre-stored correspondence between each loading stage and the display speed is shown in table 1:
TABLE 1
Loading phase Boot load stageSegment of Load progress phase Loading sprint stage
Display speed (cm/sec) 1 2 3
When the current loading stage is determined to be the starting loading stage according to the current actual loading condition of the webpage resources, inquiring that the display speed corresponding to the current loading stage is 1 cm/s from the corresponding relation between each loading stage and the display speed which are stored in advance; when the current loading stage is determined to be a loading proceeding stage according to the current actual loading condition of the webpage resources, inquiring that the display speed corresponding to the current loading stage is 2 cm/s from the corresponding relation between each loading stage and the display speed which are stored in advance; and when the current loading stage is determined to be the loading sprint stage according to the current actual loading condition of the webpage resources, inquiring the display speed corresponding to the current loading stage to be 3 cm/s from the corresponding relation between each loading stage and the display speed which are stored in advance.
204: and displaying the progress bar according to the display speed corresponding to the current loading stage.
For this step, the loading condition of the web page resource is complicated due to the influence of various factors such as the size of the loaded web page resource, the network speed when the web page resource is loaded, and the like, and if the progress bar is displayed at the preset display speed, the display of the progress bar may not accurately reflect the current loading progress. For example, when the loaded webpage resources are large, the loading process of the webpage resources takes a long time, and when the progress bar is displayed at the preset display speed, the progress bar is completely displayed when the webpage resources are not loaded, so that the displayed progress bar cannot accurately reflect the actual loading progress; when the network speed is high when the webpage resources are loaded, the webpage resource loading speed is high, and the progress bar is displayed at the preset display speed, the progress bar is not completely displayed when the webpage resources are loaded, so that the display of the progress bar cannot accurately reflect the actual loading progress. Therefore, in the method provided by this embodiment, before the progress bar is displayed according to the display speed corresponding to the current loading stage, a preset interval length may be preset in the progress bar, and when the preset interval length corresponds to the current loading stage, the progress bar is displayed according to the display speed corresponding to the current loading stage. The loading stage comprises a start loading stage, a loading proceeding stage and a loading sprint stage, so that the preset interval lengths are three, namely the preset interval length corresponding to the start loading stage, the preset interval length corresponding to the loading proceeding stage and the preset interval length corresponding to the loading sprint stage. When setting up and predetermine interval length, can set up three and predetermine interval length as the same, also can set up three and predetermine interval length as different, nevertheless because the length of progress bar is definite, consequently, no matter how many, three predetermine interval length sets up to, three predetermine interval length sum is the length of progress bar.
Specifically, when the progress bar is displayed according to the display speed corresponding to the current loading stage, if the current loading stage is the start loading stage and the display speed corresponding to the start loading stage is v1, the progress bar is displayed according to the display speed v1 corresponding to the start loading stage within the preset interval length corresponding to the start loading stage; if the current loading stage is a loading proceeding stage and the display speed corresponding to the loading proceeding stage is v2, displaying the progress bar according to the display speed v2 corresponding to the loading proceeding stage within the preset interval length corresponding to the loading proceeding stage; and if the current loading stage is a loading sprint stage and the display speed corresponding to the loading sprint stage is v3, displaying the progress bar according to the display speed v3 corresponding to the loading sprint stage within the preset interval length corresponding to the loading sprint stage.
Further, in addition to the above displaying the progress bar within the preset interval length corresponding to the current loading stage, other display situations also exist, and the other display situations include, but are not limited to, the following two situations:
in the first case: and if the length of the progress bar displayed according to the display speed corresponding to the current loading stage exceeds the preset interval length corresponding to the current loading stage and the next loading stage is not entered, displaying the progress bar at a speed smaller than the display speed corresponding to the current loading stage until the first preset length is reached or entering the next loading stage, and displaying the progress bar according to the display speed corresponding to the next loading stage.
For the first situation, if the loading task to be completed by the loading stage is not completed within the preset interval length corresponding to the current loading stage, the length of the progress bar is displayed according to the display speed corresponding to the current loading stage, which exceeds the preset interval length corresponding to the current loading stage, but the next loading stage is not entered, and at this moment, the progress bar needs to be displayed at a display speed less than the display speed corresponding to the current loading stage. Regarding the display speed less than the current loading stage, if the display speed corresponding to the current loading stage is 3 cm/sec, the display speed less than the current loading stage may be 2 cm/sec, or 1 cm/sec, and the like. If the loading task required to be completed in the current loading stage is completed before the first preset length is reached, entering the next loading stage after the loading task required to be completed in the current loading stage is completed; if the loading task required to be completed in the current loading stage is not completed when the first preset length is reached, the display of the progress bar is stopped at the position of the first preset length.
It should be noted that, because the loading stage includes a start loading stage, a loading proceeding stage, and a loading sprint stage, and because the loading sprint stage is the last stage of resource loading, if the loading of the resource is not completed in the loading sprint stage, a first preset length cannot be set outside the preset interval length of the loading sprint stage, and therefore, there are two first preset lengths, which are respectively a first preset length corresponding to the start loading stage and a first preset length corresponding to the loading proceeding stage. When the specific setting is performed, the two first preset lengths may be set to be the same, or the two first preset lengths may be set to be different. The first preset length may be 10% of the length of the progress bar, or 20% of the length of the progress bar, or of course, may be other values, but no matter how large the first preset length is, the first preset length cannot exceed the corresponding preset interval length.
For the above-described process, for convenience of understanding, the following explanation is made in detail by taking the first display speed v1, the second display speed v2, and the third display speed v3 as an example.
For example, if the length of the progress bar is set to 0 to M3Wherein, 0 to M1For loading the preset interval length, M, corresponding to the start-up phase1~M2Preset interval length, M, corresponding to the stage of loading2~M3For loading the preset interval length, M, corresponding to the sprint stage1Is M1And M2A point in between, M1~M1"is a first preset length corresponding to the loading start stage, M2Is M2And M3A point in between, M2~M2"is a first preset length corresponding to the load proceeding stage. If the current loading stage is a starting loading stage, the length of the preset interval is 0-M1In, then adopt v1Displaying the progress bar at a first preset length M1~M1Within, then use less than v1Velocity v of1Displaying progress bar if reaching M1If the loading task required to be completed in the current loading stage is not completed, the display of the progress bar is stopped at M1Putting the components on a frame; if the current loading stage is a loading proceeding stage, the preset length M is used1~M2In, then adopt v2Displaying the progress bar at a first preset length M2~M2Within, then use less than v2Velocity v of2Displaying progress bar if reaching M2If the loading task required to be completed in the current loading stage is not completed, the display of the progress bar is stopped at M2And (4) the total weight of the product.
In the second case: and if the length of the progress bar displayed according to the display speed corresponding to the current loading stage does not reach the preset interval length corresponding to the current loading stage, entering the next loading stage, and displaying the progress bar according to the display speed corresponding to the next loading stage.
For the second case, if the loading task required to be completed by the loading stage is completed within the preset interval length corresponding to the current loading stage, the length of the progress bar displayed according to the display speed corresponding to the loading stage does not reach the preset interval length corresponding to the current loading stage, and at this time, because the loading task required to be completed by the loading stage is completed, the next loading stage is entered, and the progress bar is displayed according to the display speed corresponding to the next loading stage.
For the above-described process, for ease of understanding, the first display speed v is set as follows1The second display speed is v2And the third display speed is v3The explanation is made in detail for the examples.
For example, if the length of the progress bar is set to 0 to M3Wherein, 0 to M1For loading the preset interval length, M, corresponding to the start-up phase1~M2Preset interval length, M, corresponding to the stage of loading2~M3And the length of the preset interval corresponding to the loading sprint stage. If the current progress bar is displayed to the preset interval length of 0-M1Inner point M1When the starting and loading stage is finished in the state of 0-M1Using v in1And displaying the progress bar. Due to the fact that in M1After the' process, the loading of the webpage resource enters a loading proceeding stage, so the display speed v corresponding to the loading proceeding stage is adopted2And displaying the progress bar. If the progress bar shows the preset interval length M1~M2Inner point M2The start-up loading phase is completed at M1~M2Using v in2And displaying the progress bar.
For any one of the two cases, if the current loading stage is the last loading stage, displaying the progress bar according to the display speed corresponding to the current loading stage, including but not limited to:
and displaying the progress bar in a fading-out mode according to the display speed corresponding to the current loading stage until the preset interval length corresponding to the current loading stage is reached.
Specifically, if the current loading stage is the loading sprint stage, the loading of the resource is about to be completed in the loading sprint stage, and because the remaining progress bar is not too long, the progress bar can be displayed at the display speed corresponding to the loading sprint stage in a fading manner until the preset interval length corresponding to the resource sprint stage is reached. The preset interval length may be 50% of the remaining progress bar, or 70% of the remaining progress bar, and the preset interval length is not specifically limited in this embodiment.
For the above process, for the convenience of understanding, the following is explained in detail by taking the preset section length as 50% of the remaining progress bar as an example.
For example, if the current loading stage is the last loading stage, the remaining length of the progress bar in the stage is 30% of the length of the progress bar, and the preset interval length corresponding to the last loading stage is 50% of the remaining length of the progress bar, so the preset interval length is 15% of the length of the progress bar, at this time, the progress bar is displayed at the display speed corresponding to the stage within 15% of the remaining length of the progress bar, and the progress bar is displayed in a fading manner.
Furthermore, because the loading of the web resource is complicated, the progress bar is not necessarily displayed according to the preset display speed each time the web resource is loaded, and therefore, in order to make the display speed when the web resource is loaded next time more fit the actual loading speed, the method provided by this embodiment further determines the ideal display speed of each loading stage when the progress bar is displayed this time according to the preset interval length corresponding to each loading stage when the progress bar is displayed this time and the time length of each loading stage display progress bar after the progress bar is displayed this time, and further sets the display speed of each loading stage when the progress bar is displayed next time according to the ideal display speed of each loading stage when the progress bar is displayed this time.
Specifically, the display speed of each loading stage when the progress bar is displayed next time is set according to the ideal display speed of each loading stage when the progress bar is displayed this time, which includes but is not limited to:
and averaging the ideal display speed of each loading stage when the progress bar is displayed this time and the ideal display speed of each loading stage when the progress bar is displayed for a preset number of times to obtain the average ideal display speed of each loading stage, and setting the display speed of each loading stage when the progress bar is displayed next time according to the average ideal display speed of each loading stage. The preset number of times may be 1 time, 2 times, 3 times, etc., and the preset number of times is not specifically limited in this embodiment.
For the above-mentioned processes, for the convenience of understanding, the preset number of times of 2 times will be explained in detail as an example.
For example, if the length of the progress bar is set to 0 to M3Wherein, 0 to M1For loading the preset interval length, M, corresponding to the start-up phase1~M2Preset interval length, M, corresponding to the stage of loading2~M3And the length of the preset interval corresponding to the loading sprint stage. If the time for displaying the progress bar in the process bar display starting stage, the process stage and the sprint stage is T respectively1、T2、T3And determining the ideal display speed of each loading stage when the progress bar is displayed according to the preset interval length corresponding to each stage when the progress bar is displayed at this time and the time length of the progress bar displayed at each loading stage, wherein the ideal display speed of each loading stage when the progress bar is displayed at this time is respectively as follows: v. of1、v2、v3. Wherein v is1=M1/T1、v2=M2/T2、v3=M3/T3. If the ideal speed of each loading stage when the progress bar is displayed for the previous time is v1`、v2`、v3The ideal speed of each loading stage when the progress bar is displayed twice before is v1``、v2``、v3' averaging the ideal display speed of each loading stage when the progress bar is displayed this time and the ideal display speed of each loading stage when the progress bar is displayed for the preset number of times to obtain v1*、v2*、v3Wherein, v1*=(v1+v1`+v1``)/3,v2*=(v2+v2`+v2``)/3,v3*=(v3+v3`+v3')/3. And after the average ideal display speed of each loading stage is obtained, setting the display speed of each loading stage when the progress bar is displayed next time according to the average ideal display speed of each loading stage.
Of course, in addition to setting the display speed of each loading stage when the progress bar is displayed next time by using the method, other setting methods may be used, for example, the time lengths of the progress bars displayed at each loading stage of this time and preset number of times may be averaged, and then the ideal display speed of each loading stage when the progress bar is displayed this time may be determined according to the preset interval length corresponding to each loading stage when the progress bar is displayed this time and the obtained average value of the time lengths of the progress bars displayed at each loading stage, and then the display speed of each loading stage when the progress bar is displayed next time may be set according to the ideal display speed of each loading stage when the progress bar is displayed this time.
It should be noted that, the method for displaying the progress bar provided in this embodiment is explained by taking only the loaded resource as the web page resource and the displayed progress bar as the web page progress bar as an example, and when the loaded resource is a video resource, a music resource, and the like, the method for displaying the video progress bar, the music progress bar, and the like may refer to the method for displaying the web page progress bar, and details thereof are not repeated here.
According to the method provided by the embodiment of the invention, different display speeds are preset for each loading stage, the display speed of each loading stage is constant and continuously increased, and after the current loading stage is determined according to the current actual loading condition of the webpage resources, the progress bar is displayed at the display speed corresponding to the determined loading stage. Because the display speed corresponding to each loading stage is constant and is continuously increased, the displayed progress bar is smooth and has acceleration feeling.
EXAMPLE III
Referring to fig. 3, an embodiment of the present invention provides an apparatus for displaying a progress bar, including:
a first determining module 301, configured to determine a current loading stage according to a current actual loading condition of a resource, where each loading stage is preset with a different display speed, the display speed of each loading stage is a constant speed, and the display speed of a subsequent loading stage in adjacent loading stages is increased by more than the display speed of a previous loading stage;
a second determining module 302, configured to determine a display speed corresponding to the current loading stage;
the first display module 303 is configured to display a progress bar according to a display speed corresponding to the current loading stage.
Referring to fig. 4, the first determining module 301 includes:
a first determining unit 3011, configured to determine, when a current actual loading condition of a resource is a start loading, that a current loading stage is a load starting stage, and a display speed corresponding to the load starting stage is a first display speed;
a second determining unit 3012, configured to determine, when a current actual loading condition of the resource is start loading, that a current loading stage is a loading proceeding stage, and a display speed corresponding to the loading proceeding stage is a second display speed;
a third determining unit 3013, configured to determine that the current loading stage is a loading sprint stage when the current actual loading condition of the resource is that the loading progress reaches the preset progress, and a display speed corresponding to the loading sprint stage is a third display speed;
the first display speed is lower than the second display speed, and the second display speed is lower than the third display speed.
Referring to fig. 5, the apparatus further comprises:
a first setting module 304, configured to preset a display speed corresponding to each loading stage;
a storage module 305, configured to store a corresponding relationship between each loading stage and a display speed;
the second determining module 302 is configured to query the display speed corresponding to the current loading stage from the pre-stored corresponding relationship between each loading stage and the display speed.
Referring to fig. 6, the apparatus further comprises:
the second display module 306 is configured to display the progress bar at a speed less than the display speed corresponding to the current loading stage when the length of the progress bar displayed at the display speed corresponding to the current loading stage exceeds the preset interval length corresponding to the current loading stage and the next loading stage is not entered, stop the display or enter the next loading stage until the first preset length is reached, and display the progress bar at the display speed corresponding to the next loading stage.
Referring to fig. 7, the apparatus further comprises:
the third display module 307 is configured to display the progress bar according to the display speed corresponding to the next loading stage when the length of the display progress bar according to the display speed corresponding to the current loading stage does not reach the preset interval length corresponding to the current loading stage and enters the next loading stage.
As a preferred embodiment, the first display module 303 is configured to, when the current loading stage is the last loading stage, display the progress bar in a fading manner according to the display speed corresponding to the current loading stage until a preset interval length corresponding to the current loading stage is reached.
Referring to fig. 8, the apparatus further comprises:
a third determining module 308, configured to determine an ideal display speed of each loading stage when the progress bar is displayed this time according to the preset interval length corresponding to each loading stage when the progress bar is displayed this time and the time length of the progress bar displayed at each loading stage;
the second setting module 309 is configured to set the display speed of each loading stage when the progress bar is displayed next time according to the ideal display speed of each loading stage when the progress bar is displayed this time.
As a preferred embodiment, the second setting module 309 is configured to average the ideal display speeds of the loading stages when the progress bar is displayed this time and the ideal display speeds of the loading stages when the progress bar is displayed a preset number of times before, to obtain an average ideal display speed of each loading stage, and set the display speed of each loading stage when the progress bar is displayed next time according to the average ideal display speed of each loading stage.
According to the device provided by the embodiment of the invention, different display speeds are preset for each loading stage, the display speed of each loading stage is constant and continuously increased, and after the current loading stage is determined according to the current actual loading condition of resources, the progress bar is displayed at the display speed corresponding to the determined loading stage. Because the display speed corresponding to each loading stage is constant and is continuously increased, the displayed progress bar is smooth and has acceleration feeling.
Example four
Referring to fig. 9, a schematic structural diagram of a terminal according to an embodiment of the present invention is shown, where the terminal may be used to implement the method for displaying a progress bar provided in the foregoing embodiment. Specifically, the method comprises the following steps:
the terminal 900 may include RF (Radio Frequency) circuitry 110, memory 120 including one or more computer-readable storage media, an input unit 130, a display unit 140, a sensor 150, audio circuitry 160, a WiFi (Wireless Fidelity) module 170, a processor 180 including one or more processing cores, and a power supply 190. Those skilled in the art will appreciate that the terminal structure shown in fig. 9 does not constitute a limitation of the terminal, and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the RF circuit 110 may be used for receiving and transmitting signals during information transmission and reception or during a call, and in particular, receives downlink information from a base station and then sends the received downlink information to the one or more processors 180 for processing; in addition, data relating to uplink is transmitted to the base station. In general, the RF circuitry 110 includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, and the like. In addition, the RF circuitry 110 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), e-mail, SMS (short messaging Service), etc.
The memory 120 may be used to store software programs and modules, and the processor 180 executes various functional applications and data processing by operating the software programs and modules stored in the memory 120. The memory 120 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the terminal 900, and the like. Further, the memory 120 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 120 may further include a memory controller to provide the processor 180 and the input unit 130 with access to the memory 120.
The input unit 130 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, the input unit 130 may include a touch-sensitive surface 131 as well as other input devices 132. The touch-sensitive surface 131, also referred to as a touch display screen or a touch pad, may collect touch operations by a user on or near the touch-sensitive surface 131 (e.g., operations by a user on or near the touch-sensitive surface 131 using a finger, a stylus, or any other suitable object or attachment), and drive the corresponding connection device according to a predetermined program. Alternatively, the touch sensitive surface 131 may comprise two parts, a touch detection means and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 180, and can receive and execute commands sent by the processor 180. Additionally, the touch-sensitive surface 131 may be implemented using various types of resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch-sensitive surface 131, the input unit 130 may also include other input devices 132. In particular, other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 140 may be used to display information input by or provided to a user and various graphical user interfaces of the terminal 900, which may be made up of graphics, text, icons, video, and any combination thereof. The Display unit 140 may include a Display panel 141, and optionally, the Display panel 141 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch-sensitive surface 131 may cover the display panel 141, and when a touch operation is detected on or near the touch-sensitive surface 131, the touch operation is transmitted to the processor 180 to determine the type of the touch event, and then the processor 180 provides a corresponding visual output on the display panel 141 according to the type of the touch event. Although in FIG. 9, touch-sensitive surface 131 and display panel 141 are shown as two separate components to implement input and output functions, in some embodiments, touch-sensitive surface 131 may be integrated with display panel 141 to implement input and output functions.
The terminal 900 can also include at least one sensor 150, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 141 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 141 and/or the backlight when the terminal 900 is moved to the ear. As one of the motion sensors, the gravity acceleration sensor may detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when the mobile phone is stationary, and may be used for applications of recognizing gestures of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and tapping), and other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor that may be configured in the terminal 900, which are not described herein again.
Audio circuitry 160, speaker 161, and microphone 162 may provide an audio interface between a user and terminal 900. The audio circuit 160 may transmit the electrical signal converted from the received audio data to the speaker 161, and convert the electrical signal into a sound signal for output by the speaker 161; on the other hand, the microphone 162 converts the collected sound signal into an electric signal, converts the electric signal into audio data after being received by the audio circuit 160, and then outputs the audio data to the processor 180 for processing, and then to the RF circuit 110 to be transmitted to, for example, another terminal, or outputs the audio data to the memory 120 for further processing. The audio circuitry 160 may also include an earbud jack to provide communication of peripheral headphones with the terminal 900.
WiFi belongs to a short-distance wireless transmission technology, and the terminal 900 can help a user send and receive e-mails, browse web pages, access streaming media, and the like through the WiFi module 170, and it provides wireless broadband internet access for the user. Although fig. 9 shows the WiFi module 170, it is understood that it does not belong to the essential constitution of the terminal 900 and can be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 180 is a control center of the terminal 900, connects various parts of the entire mobile phone using various interfaces and lines, and performs various functions of the terminal 900 and processes data by operating or executing software programs and/or modules stored in the memory 120 and calling data stored in the memory 120, thereby performing overall monitoring of the mobile phone. Optionally, processor 180 may include one or more processing cores; preferably, the processor 180 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 180.
Terminal 900 also includes a power supply 190 (e.g., a battery) for powering the various components, which may preferably be logically coupled to processor 180 via a power management system that may be used to manage charging, discharging, and power consumption. The power supply 190 may also include any component including one or more of a dc or ac power source, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown, the terminal 900 may further include a camera, a bluetooth module, etc., which will not be described herein. In this embodiment, the display unit of the terminal 900 is a touch screen display, and the terminal 900 further includes a memory and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors. The one or more programs include instructions for:
determining a current loading stage according to the current actual loading condition of resources, wherein each loading stage is preset with different display speeds, the display speed of each loading stage is constant, and the display speed of the next loading stage in the adjacent loading stages is increased progressively compared with the display speed of the previous loading stage;
and determining the display speed corresponding to the current loading stage, and displaying the progress bar according to the display speed corresponding to the current loading stage.
Assuming that the above is the first possible implementation manner, in a second possible implementation manner provided on the basis of the first possible implementation manner, the memory of the terminal further includes instructions for performing the following operations: determining a current loading stage according to the current actual loading condition of the resource, wherein the current loading stage comprises the following steps:
if the current actual loading condition of the resource is the starting loading, determining that the current loading stage is the loading starting stage, and the display speed corresponding to the loading starting stage is the first display speed;
if the current actual loading condition of the resources is loading start, determining that the current loading stage is a loading proceeding stage, and the display speed corresponding to the loading proceeding stage is a second display speed;
if the current actual loading condition of the resource is that the loading progress reaches the preset progress, determining that the current loading stage is a loading sprint stage, and setting the display speed corresponding to the loading sprint stage as a third display speed;
the first display speed is lower than the second display speed, and the second display speed is lower than the third display speed.
In a third possible implementation manner provided on the basis of the first possible implementation manner or the second possible implementation manner, the memory of the terminal further includes instructions for performing the following operations: before determining the display speed corresponding to the current loading stage, the method further comprises the following steps:
presetting a display speed corresponding to each loading stage, and storing the corresponding relation between each loading stage and the display speed;
determining a display speed corresponding to the current loading stage, including:
and inquiring the display speed corresponding to the current loading stage from the corresponding relation between each loading stage and the display speed which are stored in advance.
In a fourth possible implementation manner provided on the basis of the first to third possible implementation manners, the memory of the terminal further includes instructions for performing the following operations: after the progress bar is displayed according to the display speed corresponding to the current loading stage, the method further comprises the following steps:
and if the length of the progress bar displayed according to the display speed corresponding to the current loading stage exceeds the preset interval length corresponding to the current loading stage and the next loading stage is not entered, displaying the progress bar at a speed smaller than the display speed corresponding to the current loading stage until the first preset length is reached or entering the next loading stage, and displaying the progress bar according to the display speed corresponding to the next loading stage.
In a fifth possible implementation manner provided on the basis of the first to fourth possible implementation manners, the memory of the terminal further includes instructions for performing the following operations: after the progress bar is displayed according to the display speed corresponding to the current loading stage, the method further comprises the following steps:
and if the length of the progress bar displayed according to the display speed corresponding to the current loading stage does not reach the preset interval length corresponding to the current loading stage, entering the next loading stage, and displaying the progress bar according to the display speed corresponding to the next loading stage.
In a sixth possible implementation manner provided on the basis of the first to fifth possible implementation manners, the memory of the terminal further includes instructions for performing the following operations: displaying a progress bar according to a display speed corresponding to the current loading stage, comprising:
and if the current loading stage is the last loading stage, displaying the progress bar in a fading manner according to the display speed corresponding to the current loading stage until the preset interval length corresponding to the current loading stage is reached.
In a seventh possible implementation manner provided on the basis of the first to sixth possible implementation manners, the memory of the terminal further includes instructions for performing the following operations: after the progress bar is displayed, the method further comprises the following steps:
determining the ideal display speed of each loading stage when the progress bar is displayed according to the preset interval length corresponding to each loading stage when the progress bar is displayed at this time and the time length of the progress bar displayed at each loading stage;
and setting the display speed of each loading stage when the progress bar is displayed next time according to the ideal display speed of each loading stage when the progress bar is displayed this time.
In an eighth possible implementation manner provided on the basis of the first to seventh possible implementation manners, the memory of the terminal further includes instructions for performing the following operations: the method for setting the display speed of each loading stage when the progress bar is displayed next time according to the ideal display speed of each loading stage when the progress bar is displayed this time comprises the following steps:
and averaging the ideal display speed of each loading stage when the progress bar is displayed this time and the ideal display speed of each loading stage when the progress bar is displayed for a preset number of times to obtain the average ideal display speed of each loading stage, and setting the display speed of each loading stage when the progress bar is displayed next time according to the average ideal display speed of each loading stage.
According to the terminal provided by the embodiment of the invention, different display speeds are preset for each loading stage, the display speed of each loading stage is constant and continuously increased, and after the current loading stage is determined according to the current actual loading condition of resources, the progress bar is displayed at the display speed corresponding to the determined loading stage. Because the display speed corresponding to each loading stage is constant and is continuously increased, the displayed progress bar is smooth and has acceleration feeling.
EXAMPLE five
An embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium may be a computer-readable storage medium contained in the memory in the foregoing embodiment; or it may be a separate computer-readable storage medium not incorporated in the terminal. The computer-readable storage medium stores one or more programs, the one or more programs being used by one or more processors to perform a method of displaying a progress bar, the method comprising:
determining a current loading stage according to the current actual loading condition of resources, wherein each loading stage is preset with different display speeds, the display speed of each loading stage is constant, and the display speed of the next loading stage in the adjacent loading stages is increased progressively compared with the display speed of the previous loading stage;
and determining the display speed corresponding to the current loading stage, and displaying the progress bar according to the display speed corresponding to the current loading stage.
Assuming that the above is the first possible implementation manner, in a second possible implementation manner provided on the basis of the first possible implementation manner, the memory of the terminal further includes instructions for performing the following operations: determining a current loading stage according to the current actual loading condition of the resource, wherein the current loading stage comprises the following steps:
if the current actual loading condition of the resource is the starting loading, determining that the current loading stage is the loading starting stage, and the display speed corresponding to the loading starting stage is the first display speed;
if the current actual loading condition of the resources is loading start, determining that the current loading stage is a loading proceeding stage, and the display speed corresponding to the loading proceeding stage is a second display speed;
if the current actual loading condition of the resource is that the loading progress reaches the preset progress, determining that the current loading stage is a loading sprint stage, and setting the display speed corresponding to the loading sprint stage as a third display speed;
the first display speed is lower than the second display speed, and the second display speed is lower than the third display speed.
In a third possible implementation manner provided on the basis of the first possible implementation manner or the second possible implementation manner, the memory of the terminal further includes instructions for performing the following operations: before determining the display speed corresponding to the current loading stage, the method further comprises the following steps:
presetting a display speed corresponding to each loading stage, and storing the corresponding relation between each loading stage and the display speed;
determining a display speed corresponding to the current loading stage, including:
and inquiring the display speed corresponding to the current loading stage from the corresponding relation between each loading stage and the display speed which are stored in advance.
In a fourth possible implementation manner provided on the basis of the first to third possible implementation manners, the memory of the terminal further includes instructions for performing the following operations: after the progress bar is displayed according to the display speed corresponding to the current loading stage, the method further comprises the following steps:
and if the length of the progress bar displayed according to the display speed corresponding to the current loading stage exceeds the preset interval length corresponding to the current loading stage and the next loading stage is not entered, displaying the progress bar at a speed smaller than the display speed corresponding to the current loading stage until the first preset length is reached or entering the next loading stage, and displaying the progress bar according to the display speed corresponding to the next loading stage.
In a fifth possible implementation manner provided on the basis of the first to fourth possible implementation manners, the memory of the terminal further includes instructions for performing the following operations: after the progress bar is displayed according to the display speed corresponding to the current loading stage, the method further comprises the following steps:
and if the length of the progress bar displayed according to the display speed corresponding to the current loading stage does not reach the preset interval length corresponding to the current loading stage, entering the next loading stage, and displaying the progress bar according to the display speed corresponding to the next loading stage.
In a sixth possible implementation manner provided on the basis of the first to fifth possible implementation manners, the memory of the terminal further includes instructions for performing the following operations: displaying a progress bar according to a display speed corresponding to the current loading stage, comprising:
and if the current loading stage is the last loading stage, displaying the progress bar in a fading manner according to the display speed corresponding to the current loading stage until the preset interval length corresponding to the current loading stage is reached.
In a seventh possible implementation manner provided on the basis of the first to sixth possible implementation manners, the memory of the terminal further includes instructions for performing the following operations: after the progress bar is displayed, the method further comprises the following steps:
determining the ideal display speed of each loading stage when the progress bar is displayed according to the preset interval length corresponding to each loading stage when the progress bar is displayed at this time and the time length of the progress bar displayed at each loading stage;
and setting the display speed of each loading stage when the progress bar is displayed next time according to the ideal display speed of each loading stage when the progress bar is displayed this time.
In an eighth possible implementation manner provided on the basis of the first to seventh possible implementation manners, the memory of the terminal further includes instructions for performing the following operations: the method for setting the display speed of each loading stage when the progress bar is displayed next time according to the ideal display speed of each loading stage when the progress bar is displayed this time comprises the following steps:
and averaging the ideal display speed of each loading stage when the progress bar is displayed this time and the ideal display speed of each loading stage when the progress bar is displayed for a preset number of times to obtain the average ideal display speed of each loading stage, and setting the display speed of each loading stage when the progress bar is displayed next time according to the average ideal display speed of each loading stage.
According to the terminal provided by the embodiment of the invention, different display speeds are preset for each loading stage, the display speed of each loading stage is constant and continuously increased, and after the current loading stage is determined according to the current actual loading condition of resources, the progress bar is displayed at the display speed corresponding to the determined loading stage. Because the display speed corresponding to each loading stage is constant and is continuously increased, the displayed progress bar is smooth and has acceleration feeling.
EXAMPLE six
The embodiment of the invention provides a graphical user interface which is used on a terminal for displaying a progress bar, wherein the confirmation terminal for executing the operation comprises a touch screen display, a memory and one or more processors for executing one or more programs; the graphical user interface includes:
determining a current loading stage according to the current actual loading condition of resources, wherein each loading stage is preset with different display speeds, the display speed of each loading stage is constant, and the display speed of the next loading stage in the adjacent loading stages is increased progressively compared with the display speed of the previous loading stage;
and determining the display speed corresponding to the current loading stage, and displaying the progress bar according to the display speed corresponding to the current loading stage.
In summary, in the graphical user interface provided in the embodiment of the present invention, different display speeds are preset for each loading stage, the display speed of each loading stage is constant and continuously increased, and after the current loading stage is determined according to the current actual loading condition of the resource, the progress bar is displayed at the display speed corresponding to the determined loading stage. Because the display speed corresponding to each loading stage is constant and is continuously increased, the displayed progress bar is smooth and has acceleration feeling.
It should be noted that: in the device for displaying a progress bar according to the above embodiment, when the progress bar is displayed, only the division of the functional modules is used for illustration, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device for displaying a progress bar is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the device for displaying the progress bar and the method embodiment for displaying the progress bar provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiment and are not described herein again.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (11)

1. A method of displaying a progress bar, the method comprising:
determining a current loading stage according to the current actual loading condition of resources, wherein each loading stage is preset with different display speeds, the display speed of each loading stage is constant, the display speed of the next loading stage in the adjacent loading stages is increased progressively compared with the display speed of the previous loading stage, and the loading stages comprise a loading starting stage, a loading proceeding stage and a loading sprint stage;
the display speed corresponding to each loading stage is set according to the setting options; the loading stage is divided according to the loading condition of the resource, the starting loading stage refers to the stage when the resource is started to be loaded, the loading proceeding stage refers to the stage when the resource starts to be loaded, and the loading sprint stage refers to the stage when the resource is loaded to the preset progress;
determining a display speed corresponding to the current loading stage, and displaying a progress bar according to the display speed corresponding to the current loading stage;
averaging the time lengths of the progress bar displayed in each loading stage of the current time and the preset number of times;
determining the ideal display speed of each loading stage when the progress bar is displayed according to the preset interval length corresponding to each loading stage when the progress bar is displayed at the time and the obtained average value of the time lengths of the progress bars displayed at each loading stage;
averaging the ideal display speed of each loading stage when the progress bar is displayed at this time and the ideal display speed of each loading stage when the progress bar is displayed for a preset number of times to obtain the average ideal display speed of each loading stage, and setting the display speed of each loading stage when the progress bar is displayed next time according to the average ideal display speed of each loading stage;
after the displaying the progress bar according to the display speed corresponding to the current loading stage, the method further includes: and if the length of the progress bar displayed according to the display speed corresponding to the current loading stage does not reach the preset interval length corresponding to the current loading stage, entering the next loading stage, and displaying the progress bar according to the display speed corresponding to the next loading stage.
2. The method of claim 1, wherein determining the current loading stage according to the current actual loading condition of the resource comprises:
if the current actual loading condition of the resource is the loading starting, determining that the current loading stage is the loading starting stage, wherein the display speed corresponding to the loading starting stage is a first display speed;
if the current actual loading condition of the resources is loading start, determining that the current loading stage is a loading proceeding stage, wherein the display speed corresponding to the loading proceeding stage is a second display speed;
if the current actual loading condition of the resource is that the loading progress reaches the preset progress, determining that the current loading stage is a loading sprint stage, and the display speed corresponding to the loading sprint stage is a third display speed;
wherein the first display speed is less than the second display speed, and the second display speed is less than the third display speed.
3. The method of claim 1, wherein before determining the display speed corresponding to the current loading stage, further comprising:
presetting a display speed corresponding to each loading stage, and storing the corresponding relation between each loading stage and the display speed;
the determining the display speed corresponding to the current loading stage includes:
and inquiring the display speed corresponding to the current loading stage from the corresponding relation between each pre-stored loading stage and the display speed.
4. The method according to claim 1, wherein after displaying the progress bar according to the display speed corresponding to the current loading stage, the method further comprises:
and if the length of the display progress bar according to the display speed corresponding to the current loading stage exceeds the preset interval length corresponding to the current loading stage and the next loading stage is not entered, displaying the progress bar at a speed smaller than the display speed corresponding to the current loading stage until the first preset length is reached, stopping or entering the next loading stage, and displaying the progress bar according to the display speed corresponding to the next loading stage.
5. The method according to claim 1, wherein the displaying the progress bar according to the display speed corresponding to the current loading stage comprises:
and if the current loading stage is the last loading stage, displaying the progress bar in a fading-out mode according to the display speed corresponding to the current loading stage until the preset interval length corresponding to the current loading stage is reached.
6. An apparatus for displaying a progress bar, the apparatus comprising:
the first determining module is used for determining the current loading stage according to the current actual loading condition of the resource, different display speeds are preset in each loading stage, the display speed of each loading stage is constant, the display speed of the next loading stage in the adjacent loading stages is higher than that of the previous loading stage, and the loading stages comprise a starting loading stage, a loading proceeding stage and a loading sprint stage; the display speed corresponding to each loading stage is set according to the setting options; the loading stage is divided according to the loading condition of the resource, the starting loading stage refers to the stage when the resource is started to be loaded, the loading proceeding stage refers to the stage when the resource starts to be loaded, and the loading sprint stage refers to the stage when the resource is loaded to the preset progress;
the second determining module is used for determining the display speed corresponding to the current loading stage;
the first display module is used for displaying a progress bar according to the display speed corresponding to the current loading stage, and the progress bar comprises preset interval lengths corresponding to the loading stages;
the third determining module is used for averaging the time lengths of the progress bar displayed in each loading stage of the current time and the preset number of times; determining the ideal display speed of each loading stage when the progress bar is displayed according to the preset interval length corresponding to each loading stage when the progress bar is displayed at the time and the obtained average value of the time lengths of the progress bars displayed at each loading stage;
the second setting module is used for averaging the ideal display speed of each loading stage when the progress bar is displayed at this time and the ideal display speed of each loading stage when the progress bar is displayed for the preset number of times to obtain the average ideal display speed of each loading stage, and setting the display speed of each loading stage when the progress bar is displayed next time according to the average ideal display speed of each loading stage;
the device, still include: and the third display module is used for displaying the progress bar according to the display speed corresponding to the next loading stage when the length of the progress bar displayed according to the display speed corresponding to the current loading stage does not reach the preset interval length corresponding to the current loading stage and enters the next loading stage.
7. The apparatus of claim 6, wherein the first determining module comprises:
the device comprises a first determining unit, a second determining unit and a display unit, wherein the first determining unit is used for determining that a current loading stage is a loading starting stage when the current actual loading condition of resources is starting loading, and the display speed corresponding to the loading starting stage is a first display speed;
a second determining unit, configured to determine that a current loading stage is a loading proceeding stage when a current actual loading condition of the resource is loading start, where a display speed corresponding to the loading proceeding stage is a second display speed;
a third determining unit, configured to determine that the current loading stage is a loading sprint stage when the current actual loading condition of the resource is that the loading progress reaches a preset progress, where a display speed corresponding to the loading sprint stage is a third display speed;
wherein the first display speed is less than the second display speed, and the second display speed is less than the third display speed.
8. The apparatus of claim 6, further comprising:
the first setting module is used for presetting the display speed corresponding to each loading stage;
the storage module is used for storing the corresponding relation between each loading stage and the display speed;
the second determining module is used for inquiring the display speed corresponding to the current loading stage from the pre-stored corresponding relation between each loading stage and the display speed.
9. The apparatus of claim 6, further comprising:
and the second display module is used for displaying the progress bar at a speed smaller than the display speed corresponding to the current loading stage when the length of the progress bar displayed at the display speed corresponding to the current loading stage exceeds the preset interval length corresponding to the current loading stage and the next loading stage is not started, stopping the display or starting the next loading stage until the first preset length is reached, and displaying the progress bar at the display speed corresponding to the next loading stage.
10. The apparatus according to claim 6, wherein the first display module is configured to display a progress bar in a fading-out manner according to a display speed corresponding to the current loading stage until a preset interval length corresponding to the current loading stage is reached, when the current loading stage is a last loading stage.
11. A computer-readable storage medium storing at least one instruction which, when executed by a processor, implements a method of displaying a progress bar according to any one of claims 1 to 5.
CN201410018909.XA 2014-01-15 2014-01-15 Method and device for displaying progress bar Active CN104778055B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410018909.XA CN104778055B (en) 2014-01-15 2014-01-15 Method and device for displaying progress bar

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410018909.XA CN104778055B (en) 2014-01-15 2014-01-15 Method and device for displaying progress bar

Publications (2)

Publication Number Publication Date
CN104778055A CN104778055A (en) 2015-07-15
CN104778055B true CN104778055B (en) 2020-11-06

Family

ID=53619541

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410018909.XA Active CN104778055B (en) 2014-01-15 2014-01-15 Method and device for displaying progress bar

Country Status (1)

Country Link
CN (1) CN104778055B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105159676B (en) * 2015-08-31 2018-10-26 小米科技有限责任公司 The loading method of progress bar, device and system
CN105183322B (en) * 2015-09-18 2018-02-27 百度在线网络技术(北京)有限公司 Progress bar display methods and device
CN105491129A (en) * 2015-12-07 2016-04-13 天津车之家科技有限公司 Page loading progress display method and device and mobile terminal
CN106874024A (en) * 2016-07-22 2017-06-20 阿里巴巴集团控股有限公司 Load display methods, device and the electronic equipment of object
CN106095521A (en) * 2016-08-02 2016-11-09 北京奇虎科技有限公司 Plug-in loading method and device
CN107239386B (en) * 2017-06-06 2022-03-29 网易(杭州)网络有限公司 Progress display method and device
CN107797828A (en) * 2017-10-26 2018-03-13 深圳峰创智诚科技有限公司 The method and client of processing loading object
CN112486783B (en) * 2020-11-25 2022-09-27 建信金融科技有限责任公司 Progress bar display method and device
CN112929711B (en) * 2021-01-26 2023-04-28 广州欢网科技有限责任公司 Short video feed stream dynamic loading method and device suitable for intelligent television
CN113296860B (en) * 2021-05-13 2022-07-29 武汉联影医疗科技有限公司 Progress bar refreshing method and device, computer equipment and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102141953A (en) * 2011-04-01 2011-08-03 奇智软件(北京)有限公司 Method and device for showing progress bar
CN103136089A (en) * 2011-11-25 2013-06-05 腾讯科技(深圳)有限公司 Method and device for process bar display
CN103365761A (en) * 2012-03-09 2013-10-23 苹果公司 Progress bar
CN103488555A (en) * 2011-04-01 2014-01-01 北京奇虎科技有限公司 Progress bar implementation method and device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8001481B2 (en) * 2007-04-30 2011-08-16 International Business Machines Corporation Implementation of an interactive progress bar in a test application environment
KR20120020247A (en) * 2010-08-27 2012-03-08 삼성전자주식회사 Portable electronic device, apparatus and method for playing contents
CN101950238B (en) * 2010-09-14 2013-04-24 北京神州泰岳软件股份有限公司 Method for displaying document transmission progress and system
CN102207863A (en) * 2011-04-01 2011-10-05 奇智软件(北京)有限公司 Method and device for controlling progress bar to advance
CN102790961B (en) * 2011-05-20 2015-01-14 腾讯科技(深圳)有限公司 Update method of application program, mobile terminal and server
CN103049259A (en) * 2012-12-07 2013-04-17 北京百度网讯科技有限公司 Method, device and equipment for presenting graphic object representing input progress
CN103279352A (en) * 2013-05-31 2013-09-04 北京小米科技有限责任公司 Multistage progress bar, progress control method and progress control device
CN103414761B (en) * 2013-07-23 2017-02-08 北京工业大学 Mobile terminal cloud resource scheduling method based on Hadoop framework

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102141953A (en) * 2011-04-01 2011-08-03 奇智软件(北京)有限公司 Method and device for showing progress bar
CN103488555A (en) * 2011-04-01 2014-01-01 北京奇虎科技有限公司 Progress bar implementation method and device
CN103136089A (en) * 2011-11-25 2013-06-05 腾讯科技(深圳)有限公司 Method and device for process bar display
CN103365761A (en) * 2012-03-09 2013-10-23 苹果公司 Progress bar

Also Published As

Publication number Publication date
CN104778055A (en) 2015-07-15

Similar Documents

Publication Publication Date Title
CN104778055B (en) Method and device for displaying progress bar
CN105786878B (en) Display method and device of browsing object
US10725646B2 (en) Method and apparatus for switching screen interface and terminal
CN106775828B (en) Application program installation method and device and computer equipment
CN105094501B (en) Method, device and system for displaying messages in mobile terminal
CN103488450A (en) Method, device and terminal equipment for projecting picture
CN108564539B (en) Method and device for displaying image
CN109688611B (en) Frequency band parameter configuration method, device, terminal and storage medium
CN106066769B (en) A kind of processing method and mobile terminal of mobile terminal
CN106649595B (en) Object pool-based webpage starting acceleration method and device and terminal
CN104615451B (en) A kind of method and device starting application
CN104954231B (en) Method and device for sending and displaying recommendation information
CN112367425B (en) Volume adjusting method and device and terminal
CN104871636B (en) A kind of method, terminal, the network equipment and the system of secondary carrier change
CN109831771B (en) Bluetooth searching method and device, mobile terminal and storage medium
CN104932871B (en) A kind of method and device showing multimedia messages
CN108111553B (en) Method and device for providing service
CN108307531B (en) Call control method, device, user terminal and computer readable storage medium
CN106982177B (en) Upgrade control method, device and terminal
CN106657278B (en) Data transmission method and device and computer equipment
CN111308303A (en) Method and device for detecting radio frequency power amplifier of mobile terminal
CN106033358B (en) Batch installation method and device of application programs
CN105700762B (en) Method and device for displaying option information
CN105278967B (en) System updating method, device and system of mobile terminal
CN110505343B (en) Method, device, storage medium and electronic equipment for user information intercommunication

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant