Progress bar control method, device, equipment and storage medium
By segmenting and layering the progress bar, and using the preset progress algorithm to implement cascade mapping, the problem of progress bar update errors is solved and the accurate and stable update of the progress bar is ensured.
Patent Information
- Application Number
- CN202311215671.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-19
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2043-09-19
AI Technical Summary
In the existing technology, the progress update of the progress bar may cause problems such as faster update, too slow update, overflow, and lag, which are mainly caused by errors in the progress calculation of previous tasks.
The progress bar instance is segmented and layered, and the progress of the segmented progress bar of the current layer is mapped to the segmented progress bar of the previous layer according to the starting point position and weight coefficient through the preset progress algorithm to achieve cascade mapping, thereby independent Calculate the progress of each task process to prevent incorrect mapping.
It effectively avoids errors in the progress update of the progress bar, ensures the accuracy and stability of the progress bar, and prevents updates from being too fast, too slow, overflowing or stuck.
Smart Images

Figure CN117519863B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a progress bar control method, device, equipment and storage medium. Background Art
[0002] When a computer processes a task, a progress bar can display the processing progress of the task in real time in a dynamically updated manner, so that users can respond to different events according to the progress, thereby improving the user interface (UI) friendliness to users.
[0003] In the related technology, since the progress bar update needs to read the completion progress of the previous task, and then combine it with the completion progress of the current task to update the progress bar in real time, if the progress of the previous task is calculated incorrectly, the progress of the current task will also be calculated incorrectly. When it is finally mapped to the progress bar, it may cause the progress bar to update faster, too slowly, overflow, or freeze. Summary of the invention
[0004] The purpose of the present invention is to overcome the deficiencies in the prior art and provide a progress bar control method, device, equipment and storage medium, which can solve the problems of progress bar progress update being updated faster, too slow, overflowing, freezing and the like.
[0005] A first aspect of the present application provides a progress bar control method, comprising:
[0006] Construct a progress bar instance;
[0007] Segmenting and layering the progress bar instance based on the task flow;
[0008] According to the starting point position, weight coefficient and current completion degree, a preset progress algorithm is used to map the progress of the segmented progress bar of the current layer to the segmented progress bar of the previous layer to achieve cascade mapping.
[0009] In a possible implementation of the present application, it also includes:
[0010] After the cascade mapping is completed, the information parameters of the progress bar instance are passed to the platform interface for display.
[0011] In a possible implementation manner of the present application, the preset progress algorithm is used to map the progress of the segmented progress bar of the current layer to the segmented progress bar of the previous layer according to the starting position, the weight coefficient and the current completion degree, and after the cascade mapping is realized, it also includes:
[0012] The progress bar corresponding to the task flow that does not need to be displayed in the form of a progress bar is configured to not update the state of the progress bar instance.
[0013] In a possible implementation of the present application, the preset progress algorithm is used to map the progress of the segmented progress bar of the current layer to the segmented progress bar of the previous layer according to the starting point position, the weight coefficient and the current completion degree. When cascade mapping is implemented, the preset progress algorithm is determined according to the following formula:
[0014] The progress of the segmented progress bar of the previous layer = the starting position of the segmented progress bar of the current layer + the current completion degree of the segmented progress bar of the current layer * the weight coefficient of the segmented progress bar of the current layer.
[0015] A second aspect of the present application provides a progress bar control device, comprising:
[0016] Construction module, used to construct a progress bar instance;
[0017] A segmentation / layering module, used to segment and layer the progress bar instance based on the task flow;
[0018] The cascade mapping module is used to map the progress of the segmented progress bar of the current layer to the segmented progress bar of the previous layer using a preset progress algorithm according to the starting point position, weight coefficient and current completion degree, so as to realize cascade mapping.
[0019] In a possible implementation of the present application, it also includes:
[0020] The adaptation module is used to transmit the information parameters of the progress bar instance to the platform interface for display after completing the cascade mapping.
[0021] In a possible implementation of the present application, it also includes:
[0022] The configuration module is used to configure the progress bar corresponding to the task flow that does not need to be displayed in the form of a progress bar to a state where the progress bar instance is not updated.
[0023] In a possible implementation of the present application, the cascade mapping module uses a preset progress algorithm to map the progress of the segmented progress bar of the current layer to the segmented progress bar of the previous layer according to the starting point position, the weight coefficient and the current completion degree. When implementing cascade mapping, the preset progress algorithm is determined according to the following formula:
[0024] The progress of the segmented progress bar of the previous layer = the starting position of the segmented progress bar of the current layer + the current completion degree of the segmented progress bar of the current layer * the weight coefficient of the segmented progress bar of the current layer.
[0025] A third aspect of the present application provides an electronic device, including:
[0026] Processor; and
[0027] A memory having executable codes stored thereon, characterized in that when the executable codes are executed by the processor, the processor is caused to execute the progress bar control method as described above.
[0028] A fourth aspect of the present application provides a computer-readable storage medium storing executable code, which, when executed by a processor of an electronic device, causes the processor to execute the progress bar control method as described above.
[0029] The technical solution of the present application includes: constructing a progress bar instance; segmenting and layering the progress bar instance based on the task flow; and using a preset progress algorithm to map the progress of the segmented progress bar of the current layer to the segmented progress bar of the previous layer according to the starting position, weight coefficient and current completion degree, so as to realize cascade mapping. Compared with the related art, segmenting and layering the progress bar instance according to the task flow can make the progress calculation of each task flow independent of each other without interfering with each other, and at the same time use a preset progress algorithm to map the progress of the segmented progress bar of the current layer to the segmented progress bar of the previous layer, so as to realize cascade mapping. Through the above steps, it is possible to well avoid errors caused by incorrectly mapping the progress calculation of a single task flow to the progress bar, and prevent the progress bar from updating faster, too slow, overflowing, freezing, and other problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0031] Figure 1 is a flowchart of a progress bar control method shown in an embodiment of the present application;
[0032] Figure 2 is a flowchart of a progress bar control method shown in another embodiment of the present application;
[0033] Figure 3 is a flowchart of a progress bar control method shown in another embodiment of the present application;
[0034] Figure 4 is a structural schematic diagram of a progress bar control device shown in an embodiment of the present application;
[0035] Figure 5 is a structural schematic diagram of a progress bar control device shown in another embodiment of the present application;
[0036] Figure 6is a structural schematic diagram of a progress bar control device shown in another embodiment of the present application;
[0037] Figure 7 This is a schematic diagram of a structure of a progress bar example of "starting point position Start=0, weight coefficient=1" shown in an embodiment of the present application;
[0038] Figure 8 This is a schematic diagram of a structure of a progress bar example of "starting point position Start = 0, weight coefficient = 0.4" according to an embodiment of the present application;
[0039] Fig. 9 This is a schematic diagram of a structure of constructing a progress bar instance located at the Nth level according to an embodiment of the present application;
[0040] Fig.10 This is a schematic diagram of a structure of a progress bar instance located at the N+1th level, shown in an embodiment of the present application;
[0041] Fig.11 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0042] In order to facilitate the understanding of the present invention, the present invention will be described more comprehensively with reference to the accompanying drawings. The preferred embodiments of the present invention are shown in the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thoroughly understood.
[0043] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only and do not represent the only implementation method.
[0044] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0045] In the related technology, since the progress bar update needs to read the completion progress of the previous task, and then combine it with the completion progress of the current task to update the progress bar in real time, if the progress of the previous task is calculated incorrectly, the progress of the current task will also be calculated incorrectly. When it is finally mapped to the progress bar, it may cause the progress bar to update faster, too slowly, overflow, or freeze.
[0046] Therefore, the present application discloses a progress bar control method to solve the problems of progress bar progress update such as updating faster, too slow, overflow, and freeze.
[0047] The technical solution of the present application is described in detail below with reference to the accompanying drawings.
[0048] Figure 1 Detailed description is a flow chart of a progress bar control method in one embodiment of the present application.
[0049] See also Figure 1 , a progress bar control method, comprising the following steps:
[0050] Step S110: construct a progress bar instance.
[0051] A progress bar instance, referred to as a progress bar, is used to describe a computer processing task in real time. It displays the speed, degree of completion, amount of remaining unfinished tasks, and possible processing time in the form of a picture. Most of them are displayed in rectangular bars or rings. The progress bar allows users to clearly know the current task processing progress status so as to respond to different events.
[0052] Constructing a progress bar instance can be achieved through class member functions. Class member functions include parent class constructors (also called base class constructors) and subclass constructors. The parent class constructor is used to define the function of constructing and updating the progress bar. The subclass constructor inherits all the properties of the parent class constructor and is used to construct and update the progress bar.
[0053] In this embodiment, the parent class constructor is shown in Table 1, and the child class constructor is shown in Table 2.
[0054] Parent class (base class): CProgress
[0055]
[0056]
[0057] Table 1 Subclass: ClassCsubProgress:publicCProgress
[0058]
[0059] Table 2
[0060] From "ClassCsubProgress:publicCProgress" in Table 2, it can be seen that the subclass "CsubProgress" inherits all the properties of the parent class "CProgress", that is, all the functional functions defined in the parent class "CProgress" can be inherited and used by the subclass "CsubProgress".
[0061] Therefore, to construct a progress bar instance, the constructor CSubProgress in Table 2 can be used. The constructor CSubProgress has two input parameters, "Start" and "Weight". "Start" represents the starting point of the current progress bar, and "Weight" represents the weight of the current progress bar, that is, the weight coefficient.
[0062] For example, when you need to construct Figure 7 When creating a progress bar, set "Start = 0, Weight = 1" to construct a progress bar like Figure 7 The progress bar starts from Figure 7 It can be seen that the starting position of the progress bar is 0 and the end position is 100.
[0063] For example, when you need to construct Figure 8 When constructing a progress bar, we set "Start = 0, Weight = 0.4" to construct a progress bar like Figure 8 The progress bar starts from Figure 8 It can be seen that the starting position of the progress bar is 0 and the end position is 40.
[0064] Step S120: segment and layer the progress bar instance based on the task flow.
[0065] It should be noted that the progress bar includes several task processes. Taking the storage field as an example, when mass-producing flash memory, the mass-production tool involves the display of a progress bar. For mass-production tools, the mass production of flash memory involves several task processes, including pre-analysis, scanning, and table writing. Assume that pre-analysis accounts for 20% of the total task process, scanning accounts for 40% of the total task process, and table writing accounts for 40% of the total task process, and the pre-analysis, scanning, and table writing task processes are executed in sequence, that is, only when the pre-analysis task process is completed can the resulting scanning task process and table writing task process be executed.
[0066] It can be known from the description in step S110 that the constructor CsubProgress can be used to construct a progress bar instance. In this embodiment, since pre-analysis accounts for 20% of the total task flow, scanning accounts for 40% of the total task flow, and table writing accounts for 40% of the total task flow, and the pre-analysis, scanning, and table writing task flows are executed sequentially, it can be known that the starting position of the pre-analysis task flow is Start=0, and the weight coefficient Weight=0.2; the starting position of the scanning task flow is Start=20, and the weight coefficient Weight=0.4; the starting position of the table writing task flow is Start=60, and the weight coefficient Weight=0.4. Therefore, by configuring different "Start" and "Weight", the progress bar in step S110 is segmented, and the segmented progress bar is as follows. Fig. 9 ,from Fig. 9 It can be seen that Fig. 9 The progress bar in the diagram includes three task processes: pre-analysis, scanning, and table writing.
[0067] In addition, pre-analysis, scanning, and table writing can each contain several sub-task processes. Based on this situation, pre-analysis, scanning, and table writing can be further segmented. However, considering that further segmentation will increase the number of segments of the current progress bar, a progress bar can be constructed based on pre-analysis, scanning, and table writing. However, the progress bar at this time is at a different level. To better understand this process, assume that:
[0068] The pre-analysis task flow includes task flow A, task flow B, and task flow C. Task flow A accounts for 20% of the pre-analysis task flow, task flow B accounts for 40% of the pre-analysis task flow, and task flow C accounts for 40% of the pre-analysis task flow. Task flow A, task flow B, and task flow C are executed in the same sequence.
[0069] The scanning task process includes D task process, E task process, and F task process. The D task process accounts for 30% of the scanning task process, the E task process accounts for 40% of the scanning task process, and the F task process accounts for 30% of the scanning task process. The D task process, E task process, and F task process are also executed sequentially.
[0070] The table writing task flow includes the G task flow, the H task flow, and the I task flow. The G task flow accounts for 50% of the table writing task flow, the H task flow accounts for 10% of the table writing task flow, and the I task flow accounts for 40% of the table writing task flow. The G task flow, the H task flow, and the I task flow are also executed sequentially.
[0071] The same constructor CsubProgress is used to construct the following by inputting different "Start" and "Weight": Fig.10 The progress bar starts from Fig.10 It can be seen that Fig.10 There are three progress bars: the pre-analysis progress bar, which is divided into three sections, corresponding to the A / B / C task flow, the scanning progress bar, which is divided into three sections, corresponding to the D / E / F task flow, and the table writing progress bar, which is divided into three sections, corresponding to the G / H / I task flow. Fig. 9 and Fig.10 The progress bar is equivalent to Fig. 9 The progress bar is the highest level progress bar, that is, it is located at the Nth level. Fig.10 The three progress bars are the progress bars of the next level, that is, located at the N+1 level. Similarly, if the A / B / C task flows each have a corresponding sub-task flow, the progress bar of the next level (that is, located at the N+2 level) can be constructed, and so on. It can be understood that the technical solution of this embodiment can segment and layer the progress bar corresponding to each task flow, and each task flow has its corresponding starting position Start and weight coefficient Weight, which do not interfere with each other. The progress calculation of the pre-analysis task flow does not depend on the progress calculation of the scanning task flow and the table writing task flow, and the pre-analysis task flow can also include A / B / C task flows, and each task flow also has a corresponding starting position Start and weight coefficient Weight, and also does not interfere with each other.
[0072] For programmers, since the progress bar is divided into segments, when there is a problem with the progress calculation of the progress bar, the programmer only needs to find the code where the progress calculation of the corresponding task process is erroneous, and fix the bug to complete the repair of the progress bar.
[0073] Step S130 , according to the starting position Start, the weight coefficient Weight and the current completion degree Progress, a preset progress algorithm is used to map the progress of the segmented progress bar of the current layer to the segmented progress bar of the previous layer, so as to realize cascade mapping.
[0074] Combination Fig. 9 and Fig.10It can be seen that the segmented progress bar of the current layer is further refined on the basis of the segmented progress bar of the previous layer. The progress bar is segmented and layered in order to make the progress calculations of different task processes independent of each other and not affect each other, so as to ensure that there are no problems in updating the progress bar. However, the update progress of the segmented progress bar of the current layer (the N+1th layer) must eventually be fed back to the segmented progress bar of the previous layer (the Nth layer). This is because the progress bar can only display the highest level. The progress bars below the highest level are not displayed. They are only constructed to make the progress calculations of each task process independent of each other. Therefore, it is necessary to establish a cascade mapping mechanism between the segmented progress bar of the current layer and the segmented progress bar of the previous layer to ensure that the update progress of the progress bar of the highest level is accurate.
[0075] When dividing the progress bar into segments and layers, you need to enter the starting position Start and the weight coefficient Weight. Through these two parameters, the segmented progress bar of the current layer is limited to prevent the segmented progress bar of the current layer from overflowing when it is mapped to the segmented progress bar of the previous layer.
[0076] The principle is explained as follows (combined with Fig. 9 and Fig.10 );
[0077] For the progress bar of the pre-analysis task process at the N+1th level, it is a progress bar with a completion rate of 0 to 100% at the N+1th level. When mapped to the upper layer (Nth level), the starting point of the pre-analysis task process Start=0, and the pre-analysis task process corresponds to a progress bar with a completion rate of 0 to 20% (corresponding to a weight coefficient of 0.2). Even if the completion rate of the progress bar at the N+1th level reaches 100%, when mapped to the Nth level, it only corresponds to a progress bar with a completion rate of 20%.
[0078] For the progress bar of the scanning task process at the N+1th level, it is a 0-100% progress bar at the N+1th level, and when mapped to the previous layer (Nth level), the starting point of the scanning task process is Start=20, and the scanning task process corresponds to a 20-60% progress bar (corresponding to a weight coefficient of 0.4). Even if the completion degree of the progress bar at the N+1th level reaches 100%, when mapped to the Nth level, the corresponding progress bar is only 40% complete.
[0079] For the progress bar of the table writing task process at the N+1th level, it is a 0-100% progress bar at the N+1th level, and when mapped to the upper layer (Nth level), the starting point of the table writing task process Start=60, and the scanning task process corresponds to a 60-100% progress bar (corresponding to a weight coefficient of 0.4). Even if the completion degree of the progress bar at the N+1th level reaches 100%, when mapped to the Nth level, the corresponding progress bar is only 40% complete.
[0080] Therefore, in this embodiment, the preset progress algorithm is determined according to the following formula:
[0081] The progress Position of the segmented progress bar of the current layer = the starting position Start of the segmented progress bar of the current layer + the current degree of completion Progress of the segmented progress bar of the current layer * the weight coefficient Weight of the segmented progress bar of the current layer.
[0082] Among them, the starting point Start and the weight coefficient Weight are the parameters that need to be input when constructing the progress bar, and the current completion degree Progress is the result of computer calculation and processing, which is calculated by the computer based on the execution progress of the current task process.
[0083] Compared with the related art, compared with the technical solution of this embodiment, when the progress bar is segmented and layered, the progress calculation of each task process is independent of each other and does not affect each other. In addition, the corresponding starting position Start and weight coefficient Weight are pre-configured to limit the segmented progress bar of the current layer to prevent overflow when the segmented progress bar of the current layer is mapped to the segmented progress bar of the previous layer. In addition, a preset progress algorithm is used to establish a cascade mapping mechanism between the segmented progress bar of the current layer and the segmented progress bar of the previous layer, so that when the segmented progress bars at different levels are finally mapped to the progress bar of the highest level, the progress calculation of the progress bar of the highest level is accurate.
[0084] Furthermore, the technical solution of this embodiment, even if an error occurs in the progress calculation of a task process, will not cause serious errors in the progress calculation of the highest-level progress bar when it is finally mapped to the highest-level progress bar under the restrictions of the weight coefficient Weight and the segmentation restrictions.
[0085] Figure 2 Detailed description of the invention is given in detail below.
[0086] See also Figure 2 , a progress bar control method, comprising the following steps:
[0087] Step S210: construct a progress bar instance.
[0088] It should be noted that the construction of the progress bar instance can be achieved through a class member function. The class member function includes a parent class constructor (also called a base class constructor) and a subclass constructor, wherein the parent class constructor is used to define a function function for constructing and updating the progress bar, and the subclass constructor inherits all the properties of the parent class constructor and is used to construct and update the progress bar. For the description of the parent class constructor and the subclass constructor, please refer to Table 1, Table 2 and the relevant content of step S110, which will not be repeated here.
[0089] Step S120: segment and layer the progress bar instance based on the task flow.
[0090] It should be noted that the progress bar includes several task processes. Taking the storage field as an example, when mass-producing flash memory, the mass-production tool involves the display of a progress bar. For mass-production tools, the mass production of flash memory involves several task processes, including pre-analysis, scanning, and table writing. Assume that pre-analysis accounts for 20% of the total task process, scanning accounts for 40% of the total task process, and table writing accounts for 40% of the total task process, and the pre-analysis, scanning, and table writing task processes are executed in sequence, that is, only when the pre-analysis task process is completed can the resulting scanning task process and table writing task process be executed.
[0091] According to the task flow, by configuring different starting positions Start and weight coefficients, the progress bar can be segmented and layered. For detailed examples of progress bar construction, please refer to the relevant content of step S120, which will not be repeated here. It can be understood that the technical solution of this embodiment can segment and layer the progress bar corresponding to each task flow, and each task flow has its corresponding starting position Start and weight coefficient Weight, which do not interfere with each other. The progress calculation of the current task flow does not depend on the progress calculation of other task flows, and the current task flow can also include other task flows, each of which also has a corresponding starting position Start and weight coefficient Weight, and also does not interfere with each other.
[0092] For programmers, since the progress bar is divided into segments, when there is a problem with the progress calculation of the progress bar, the programmer only needs to find the code where the progress calculation of the corresponding task process is erroneous, and fix the bug to complete the repair of the progress bar.
[0093] Step S230: Map the progress of the segmented progress bar of the current layer to the segmented progress bar of the previous layer using a preset progress algorithm according to the starting point Start, the weight coefficient Weight and the current completion degree Progress, so as to realize cascade mapping.
[0094] Combination Fig. 9 and Fig.10 It can be seen that the segmented progress bar of the current layer is further refined on the basis of the segmented progress bar of the previous layer. The progress bar is segmented and layered in order to make the progress calculations of different task processes independent of each other and not affect each other, so as to ensure that there are no problems in updating the progress bar. However, the update progress of the segmented progress bar of the current layer (the N+1th layer) must eventually be fed back to the segmented progress bar of the previous layer (the Nth layer). This is because the progress bar can only display the highest level. The progress bars below the highest level are not displayed. They are only constructed to make the progress calculations of each task process independent of each other. Therefore, it is necessary to establish a cascade mapping mechanism between the segmented progress bar of the current layer and the segmented progress bar of the previous layer to ensure that the update progress of the progress bar of the highest level is accurate.
[0095] When dividing the progress bar into segments and layers, you need to enter the starting position Start and the weight coefficient Weight. Through these two parameters, the segmented progress bar of the current layer is limited to prevent the segmented progress bar of the current layer from overflowing when it is mapped to the segmented progress bar of the previous layer.
[0096] The principle is explained as follows (combined with Fig. 9 and Fig.10 );
[0097] For the progress bar of the pre-analysis task process at the N+1th level, it is a progress bar with a completion rate of 0 to 100% at the N+1th level. When mapped to the upper layer (Nth level), the starting point of the pre-analysis task process Start=0, and the pre-analysis task process corresponds to a progress bar with a completion rate of 0 to 20% (corresponding to a weight coefficient of 0.2). Even if the completion rate of the progress bar at the N+1th level reaches 100%, when mapped to the Nth level, it only corresponds to a progress bar with a completion rate of 20%.
[0098] For the progress bar of the scanning task process at the N+1th level, it is a 0-100% progress bar at the N+1th level, and when mapped to the previous layer (Nth level), the starting point of the scanning task process is Start=20, and the scanning task process corresponds to a 20-60% progress bar (corresponding to a weight coefficient of 0.4). Even if the completion degree of the progress bar at the N+1th level reaches 100%, when mapped to the Nth level, the corresponding progress bar is only 40% complete.
[0099] For the progress bar of the table writing task process at the N+1th level, it is a 0-100% progress bar at the N+1th level, and when mapped to the upper layer (Nth level), the starting point of the table writing task process Start=60, and the scanning task process corresponds to a 60-100% progress bar (corresponding to a weight coefficient of 0.4). Even if the completion degree of the progress bar at the N+1th level reaches 100%, when mapped to the Nth level, the corresponding progress bar is only 40% complete.
[0100] In this embodiment, the preset progress algorithm is determined according to the following formula:
[0101] The progress Position of the segmented progress bar of the current layer = the starting position Start of the segmented progress bar of the current layer + the current degree of completion Progress of the segmented progress bar of the current layer * the weight coefficient Weight of the segmented progress bar of the current layer.
[0102] Among them, the starting point Start and the weight coefficient Weight are the parameters that need to be input when constructing the progress bar, and the current completion degree Progress is the result of computer calculation and processing, which is calculated by the computer based on the execution progress of the current task process.
[0103] Compared with the related art, compared with the technical solution of this embodiment, when the progress bar is segmented and layered, the progress calculation of each task process is independent of each other and does not affect each other. In addition, the corresponding starting position Start and weight coefficient Weight are pre-configured to limit the segmented progress bar of the current layer to prevent overflow when the segmented progress bar of the current layer is mapped to the segmented progress bar of the previous layer. In addition, a preset progress algorithm is used to establish a cascade mapping mechanism between the segmented progress bar of the current layer and the segmented progress bar of the previous layer, so that when the segmented progress bars at different levels are finally mapped to the progress bar of the highest level, the progress calculation of the progress bar of the highest level is accurate.
[0104] Furthermore, the technical solution of this embodiment, even if an error occurs in the progress calculation of a task process, will not cause serious errors in the progress calculation of the highest-level progress bar when it is finally mapped to the highest-level progress bar under the restrictions of the weight coefficient Weight and the segmentation restrictions.
[0105] Step S240: After completing the cascade mapping, the information parameters of the progress bar instance are transmitted to the platform interface for display.
[0106] After completing the cascade mapping, the progress bar at the highest level can be updated in real time, and the adapter CSubProgressT can be used to pass the relevant information parameters of the progress bar instance to the platform interface for display. The adapter CSubProgressT is also a subclass of the parent class constructor CProgress, and can also inherit all the properties of the parent class constructor Cprogress, that is, the adapter CsubProgressT can also be used to construct and update the progress bar.
[0107] Adapter CsubProgressT is shown in Table 3.
[0108] Adapter: template<typename T> class CSubProgressT:public CProgress
[0109]
[0110] Table 3
[0111] In addition, the adapter function CsubProgressT also has the function of passing information parameters of the proximity bar instance to the platform interface. "Imp" is the platform interface. By passing "Start" and "Weight" to the platform interface, the progress bar is displayed.
[0112] See also Figure 3 , a progress bar control method, characterized in that it includes the following steps:
[0113] Step S310: construct a progress bar instance.
[0114] For the relevant description of step S310, please refer to step S210, which will not be repeated here.
[0115] Step S320: segment and layer the progress bar instance based on the task flow.
[0116] For the relevant description of step S320, please refer to step S220, which will not be repeated here.
[0117] Step S330: Map the progress of the segmented progress bar of the current layer to the segmented progress bar of the previous layer using a preset progress algorithm according to the starting point Start, the weight coefficient Weight and the current completion degree Progress, so as to realize cascade mapping.
[0118] For the relevant description of step S330, please refer to step S230, which will not be repeated here.
[0119] Step S340: configure the progress bar corresponding to the task flow that does not need to be displayed in the form of a progress bar to a state where the progress bar instance is not updated.
[0120] It should be noted that in the business implementation code, there are many functional modules that are reused. These modules will update the progress bar, but some calls cannot update the progress bar. When calling these modules that do not update the progress bar, use the instance of the subclass constructor CDummyProgress instead of the subclass constructor CSubProgress. This implements the function call without rewriting different interfaces, which is very helpful for programmers to do program design.
[0121] The subclass constructor CDummyProgress is shown in Table 4.
[0122] Subclass constructor: classCDummyProgress:public CProgress
[0123]
[0124] Table 4
[0125] Step S350: After completing the cascade mapping, the information parameters of the progress bar instance are transmitted to the platform interface for display.
[0126] For the relevant description of step S350, please refer to step S240, which will not be repeated here.
[0127] Corresponding to the aforementioned method embodiment, the present application also discloses a progress bar control device and corresponding embodiments.
[0128] like Figure 4 Schematic diagram of the structure of a progress bar control device in one embodiment of the present application.
[0129] See also Figure 4 , a progress bar control device 400 includes: a construction module 410, a segmentation / layering module 420 and a cascade mapping module 430.
[0130] The construction module 410 is used to construct a progress bar instance.
[0131] The segmentation / layering module 420 is used to segment and layer the progress bar instance based on the task flow.
[0132] The cascade mapping module 430 is used to map the progress of the segmented progress bar of the current layer to the segmented progress bar of the previous layer using a preset progress algorithm according to the starting point position, the weight coefficient and the current completion degree, so as to realize cascade mapping.
[0133] The cascade mapping module 430 uses a preset progress algorithm to map the progress of the segmented progress bar of the current layer to the segmented progress bar of the previous layer according to the starting point position, the weight coefficient and the current completion degree. When the cascade mapping is implemented, the preset progress algorithm is determined according to the following formula:
[0134] The progress of the segmented progress bar of the current layer = the starting position of the segmented progress bar of the current layer + the current completion degree of the segmented progress bar of the current layer * the weight coefficient of the segmented progress bar of the current layer.
[0135] It should be noted that the progress bar control method implemented by the progress bar control device disclosed in this embodiment is the same as the above embodiment, so it will not be described in detail here. Optionally, each module in this embodiment and the above other operations or functions are respectively for implementing the methods in the above embodiments.
[0136] like Figure 5 It is a structural schematic diagram of a progress bar control device in another embodiment of the present application.
[0137] See also Figure 5 , a progress bar control device 400 includes: a construction module 410, a segmentation / layering module 420, a cascade mapping module 430 and an adaptation module 440.
[0138] For details on the construction module 410, the segmentation / layering module 420, and the cascade mapping module 430, please refer to Figure 4 , I will not go into details here.
[0139] The adaptation module 440 is used to transmit the information parameters of the progress bar instance to the platform interface for display after completing the cascade mapping.
[0140] It should be noted that the progress bar control method implemented by the progress bar control device disclosed in this embodiment is the same as the above embodiment, so it will not be described in detail here. Optionally, each module in this embodiment and the above other operations or functions are respectively for implementing the methods in the above embodiments.
[0141] like Figure 6 It is a structural schematic diagram of a progress bar control device in another embodiment of the present application.
[0142] See also Figure 6 , a progress bar control device 400 includes: a construction module 410, a segmentation / layering module 420, a cascade mapping module 430, a configuration module 450, and an adaptation module 440.
[0143] For details on the construction module 410, the segmentation / layering module 420, the cascade mapping module 430, and the adaptation module 440, please refer to Figure 5 , I will not go into details here.
[0144] The configuration module 450 is used to configure the progress bar corresponding to the task flow that does not need to be displayed in the form of a progress bar to a state where the progress bar instance is not updated.
[0145] It should be noted that the progress bar control method implemented by the progress bar control device disclosed in this embodiment is the same as the above embodiment, so it will not be described in detail here. Optionally, each module in this embodiment and the above other operations or functions are respectively for implementing the methods in the above embodiments.
[0146] See also Fig.11 Another embodiment of the present application shows a computing electronic device 1100 including a memory 1110 and a processor 1120 .
[0147] The processor 1120 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0148] A general purpose processor may be a microprocessor or the processor may be any conventional processor. The memory 1110 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage.
[0149] Among them, ROM can store static data or instructions required by processor 1120 or other modules of the computer. The permanent storage device can be a readable and writable storage device. The permanent storage device can be a non-volatile storage device that does not lose the stored instructions and data even if the computer is powered off. In some embodiments, the permanent storage device uses a large-capacity storage device (such as a magnetic or optical disk, flash memory) as a permanent storage device.
[0150] In some other embodiments, the permanent storage device may be a removable storage device (e.g., a floppy disk, an optical drive). The system memory may be a read-write storage device or a volatile read-write storage device, such as a dynamic random access memory. The system memory may store some or all of the instructions and data required by the processor at run time.
[0151] In addition, memory 1110 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (e.g., DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), magnetic disks and / or optical disks may also be used.
[0152] In some embodiments, the memory 1110 may include a removable storage device that can be read and / or written, such as a laser disc (CD), a read-only digital versatile disc (e.g., DVD-ROM, double-layer DVD-ROM), a read-only Blu-ray disc, an ultra-density optical disc, a flash memory card (e.g., SD card, min SD card, Micro-SD card, etc.), a magnetic floppy disk, etc. Computer-readable storage media do not include carrier waves and instantaneous electronic signals transmitted wirelessly or by wire. The memory 1110 stores executable code, and when the executable code is processed by the processor 1120, the processor 1120 can execute part or all of the methods described above.
[0153] In addition, the method according to the present application may also be implemented as a computer program or a computer program product, which includes computer program code instructions for executing some or all of the steps in the above method of the present application.
[0154] Alternatively, the present application can also be implemented as a computer-readable storage medium (or non-transitory machine-readable storage medium or machine-readable storage medium) on which executable code (or computer program or computer instruction code) is stored. When the executable code (or computer program or computer instruction code) is executed by a processor of an electronic device (or server, etc.), the processor executes part or all of the steps of the above-mentioned method according to the present application.
[0155] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A progress bar control method, characterized in that: include: Construct a progress bar instance; The progress bar instance is segmented and layered based on the task flow, wherein the progress calculations of the progress bars at the same level and in different segments are independent of each other and do not interfere with each other; According to the starting point position, weight coefficient and current completion degree, a preset progress algorithm is used to map the progress of the segmented progress bar of the current layer to the segmented progress bar of the previous layer to achieve cascade mapping, wherein the preset progress algorithm is determined according to the following formula: the progress of the segmented progress bar of the previous layer = the starting point position of the segmented progress bar of the current layer + the completion degree of the segmented progress bar of the current layer * the weight coefficient of the segmented progress bar of the current layer.
2. The progress bar control method according to claim 1, characterized in that: Also includes: After the cascade mapping is completed, the information parameters of the progress bar instance are passed to the platform interface for display.
3. The progress bar control method according to claim 2, characterized in that: The method further includes mapping the progress of the segmented progress bar of the current layer to the segmented progress bar of the previous layer using a preset progress algorithm according to the starting point position, the weight coefficient and the current completion degree, and realizing cascade mapping: The progress bar corresponding to the task flow that does not need to be displayed in the form of a progress bar is configured to not update the state of the progress bar instance.
4. A progress bar control device, characterized in that: include: Construction module, used to construct a progress bar instance; A segmentation / layering module, used to segment and layer the progress bar instance based on the task flow, wherein the progress calculations of the progress bars at the same level and in different segments are independent of each other and do not interfere with each other; The cascade mapping module is used to map the progress of the segmented progress bar of the current layer to the segmented progress bar of the previous layer using a preset progress algorithm according to the starting point position, weight coefficient and current completion degree, so as to realize cascade mapping, wherein the preset progress algorithm is determined according to the following formula: the progress of the segmented progress bar of the previous layer = the starting point position of the segmented progress bar of the current layer + the completion degree of the segmented progress bar of the current layer * the weight coefficient of the segmented progress bar of the current layer.
5. The progress bar control device according to claim 4, characterized in that: Also includes: The adaptation module is used to transmit the information parameters of the progress bar instance to the platform interface for display after completing the cascade mapping.
6. The progress bar control device according to claim 5, characterized in that: Also includes: The configuration module is used to configure the progress bar corresponding to the task flow that does not need to be displayed in the form of a progress bar to not update the state of the progress bar instance.
7. An electronic device comprising: processor; as well as A memory having executable codes stored thereon, wherein when the executable codes are executed by the processor, the processor is caused to execute the progress bar control method according to any one of claims 1 to 3.
8. A computer-readable storage medium, characterized in that: An executable code is stored, and when the executable code is executed by a processor of an electronic device, the processor is caused to execute the progress bar control generation method according to any one of claims 1 to 3.
