WO2017045482A1 - Parent task progress update method and apparatus - Google Patents

Parent task progress update method and apparatus Download PDF

Info

Publication number
WO2017045482A1
WO2017045482A1 PCT/CN2016/091586 CN2016091586W WO2017045482A1 WO 2017045482 A1 WO2017045482 A1 WO 2017045482A1 CN 2016091586 W CN2016091586 W CN 2016091586W WO 2017045482 A1 WO2017045482 A1 WO 2017045482A1
Authority
WO
WIPO (PCT)
Prior art keywords
subtask
progress
time
parent task
percentage
Prior art date
Application number
PCT/CN2016/091586
Other languages
French (fr)
Chinese (zh)
Inventor
韩竞竞
龙慧
李欣
Original Assignee
北京奇虎科技有限公司
奇智软件(北京)有限公司
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 北京奇虎科技有限公司, 奇智软件(北京)有限公司 filed Critical 北京奇虎科技有限公司
Publication of WO2017045482A1 publication Critical patent/WO2017045482A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine

Definitions

  • the present invention relates to the field of Internet technologies, and in particular, to a parent task progress update method and apparatus.
  • a parent task consists of multiple subtasks. According to the number of subtasks, the progress of the parent task is equally divided. After the subtask execution ends, the progress corresponding to the subtask is updated in the progress bar of the parent task.
  • the execution time of multiple subtasks is generally different. Assigning the same percentage progress to multiple subtasks does not accurately reflect the update progress and task completion status, that is, subtasks with short execution time and subtasks with long execution time. The progress of the parent task updated after the execution is the same, which does not accurately reflect the progress of the task.
  • a parent task consists of 10 subtasks, and the percentage of each child task's progress toward the parent task is equally divided by 10%. That is, when a subtask is executed, the progress bar of the parent task is updated by 10%. If the execution time of the 1st-9th subtask is short, and the execution time of the 10th subtask exceeds the total execution time of the first 9 subtasks, the progress of the parent task is quickly updated to 90%, and the last 10% of the progress is delayed. Can't update. For the user, when the progress of the parent task is updated to 90%, the user thinks that the task is about to end. However, the remaining 10% of the progress can not be updated so that the user mistakenly believes that the task is stuck, causing the user to re-execute the task, resulting in wasted system resources and wasted user time.
  • the present invention has been made in order to provide an overcoming of the above problems or at least partially The parent task progress update method and the corresponding parent task progress update device for solving the above problem.
  • a parent task progress update method includes multiple subtasks, and the method includes:
  • the percentage progress of the subtask is supplemented in the progress of the parent task to update the progress of the parent task.
  • a parent task progress update apparatus includes:
  • a calculation module configured to separately calculate a maximum execution time of each of the plurality of subtasks
  • the determining module is adapted to divide the progress of the parent task according to the maximum execution time of each subtask, and determine a percentage progress corresponding to each subtask;
  • the complement module is adapted to, during the execution of the subtask, if any subtask execution is detected, the percentage progress of the subtask is supplemented in the progress of the parent task to update the progress of the parent task.
  • the maximum execution time of each of the plurality of subtasks is separately calculated, and the progress of the parent task is divided according to the maximum execution time of each subtask, and the percentage progress corresponding to each subtask is determined, and the subtask execution is performed.
  • the percentage progress of the sub-task is supplemented in the progress of the parent task to update the progress of the parent task, so that the progress of the parent task can be accurately divided, more accurately in the parent task.
  • the progress of the subtask is reflected in the progress, which overcomes the defect that the progress of the parent task is equally divided according to the number of subtasks in the prior art, and the defect of the progress of the parent task cannot be accurately reflected.
  • FIG. 1 shows a flow chart of a parent task progress update method in accordance with one embodiment of the present invention
  • FIG. 2 is a flow chart showing a parent task progress update method according to another embodiment of the present invention.
  • FIG. 3 is a block diagram showing the structure of a parent task progress updating apparatus according to an embodiment of the present invention.
  • FIG. 4 is a block diagram showing the structure of a parent task progress updating apparatus according to another embodiment of the present invention.
  • FIG. 5 schematically illustrates a block diagram of a computing device for performing a parent task progress update method in accordance with an embodiment of the present invention
  • Fig. 6 schematically shows a storage unit for holding or carrying program code implementing a parent task progress update method according to an embodiment of the present invention.
  • FIG. 1 shows a flow chart of a parent task progress update method in accordance with one embodiment of the present invention.
  • the parent task in this embodiment includes multiple subtasks. As shown in FIG. 1, the method includes the following steps:
  • Step S100 respectively calculating a maximum execution time of each of the plurality of subtasks.
  • the maximum execution time refers to the maximum time required to perform a task to ensure that the task can be fully executed during the time period.
  • Step S101 according to the maximum execution time of each subtask, divide the progress of the parent task, and determine the percentage progress corresponding to each subtask.
  • the parent task contains multiple subtasks. After each subtask is executed, the percentage progress corresponding to the subtask is updated in the progress of the parent task, that is, the progress of the parent task is updated. It can visually reflect the completion of the task. In this embodiment, in order to more accurately represent the completion of the subtask in the progress of the parent task, the progress of the parent task is divided according to the maximum execution time of each subtask.
  • the specific performance is that the maximum execution time of the subtask is short, the smaller the percentage of the progress of the parent task, the longer the maximum execution time of the subtask, and the greater the percentage of the progress of the parent task, so that the more accurate
  • the division of the parent task progress overcomes the defect that the progress of the parent task is equally divided according to the number of subtasks in the prior art, and the defect of the progress of the parent task cannot be accurately reflected.
  • Step S102 During the execution of the subtask, if any subtask execution is detected, the percentage progress of the subtask is supplemented in the progress of the parent task to update the progress of the parent task.
  • the flag for ending the subtask execution is a message that the execution of the task sent by the subtask execution process ends. After receiving the message, it can be judged that the subtask execution ends, and the percentage progress of the subtask is supplemented in the progress of the parent task to update the progress of the parent task.
  • the maximum execution time of each of the plurality of subtasks is separately calculated, and the progress of the parent task is divided according to the maximum execution time of each subtask, and the percentage progress of each subtask is determined.
  • the percentage progress of the subtask is supplemented in the progress of the parent task to update the progress of the parent task, so that the progress of the parent task can be accurately divided, and more accurate.
  • the completion of the subtask is reflected in the progress of the parent task, which overcomes the defect that the progress of the parent task is equally divided according to the number of subtasks in the prior art, and the defect of the progress of the parent task cannot be accurately reflected.
  • FIG. 2 shows a flow chart of a parent task progress update method in accordance with another embodiment of the present invention. As shown in FIG. 2, the method includes the following steps:
  • Step S200 respectively calculating a maximum execution time of each of the plurality of subtasks.
  • the maximum execution time refers to the maximum time required to perform a task to ensure that the task can be fully executed during the time period.
  • Step S201 Calculate the execution time of the parent task according to the maximum execution time of the plurality of subtasks.
  • the execution time of the parent task is the sum of the maximum execution times of the plurality of subtasks.
  • the execution time of the parent task can be calculated according to the maximum execution time of each subtask calculated in step S200.
  • Step S202 according to the ratio of the maximum execution time of each subtask to the execution time of the parent task. Determine the percentage of each child task's progress toward the parent task to determine the percentage progress for each child task.
  • the percentage progress corresponding to each subtask is the percentage progress obtained by the sum of the subtask's percentage of the progress of the parent task and the percentage of the subtasks that have been sequentially executed before the subtask, which is the percentage of the progress of the parent task, that is, Say, the percentage progress of the second subtask is the percentage progress of the sum of the percentage of the second subtask in the progress of the parent task and the percentage of the first subtask in the progress of the parent task.
  • the parent task contains 5 subtasks.
  • the maximum execution time of the 5 subtasks is 30 minutes, 50 minutes, 15 minutes, 100 minutes, and 6 minutes.
  • the sum of the maximum execution time of the 5 subtasks is 195 minutes, that is, the parent task.
  • the execution time is 196 minutes.
  • the percentage progress of the first subtask is 14.9%; the percentage progress of the second subtask is 39.8% (14.9%+24.9%); the percentage progress of the third subtask is 47.3% (14.9%+24.9%+7.5%)
  • the percentage progress of the fourth subtask is 97.1% (14.9%+24.9%+7.5%+49.8%); the percentage progress of the fifth subtask is 100% (14.9%+24.9%+7.5%+49.8%+2.9) %); here is just an example and does not have any limiting effect.
  • the maximum execution time of each subtask is different. According to the ratio of the maximum execution time of each subtask to the execution time of the parent task, the percentage of each subtask's progress of the parent task is determined, and then the percentage progress of each subtask is determined, thereby ensuring the child.
  • the shorter the maximum execution time of the task the smaller the percentage of the progress of the parent task, the longer the maximum execution time of the child task, and the greater the percentage of the progress of the parent task, achieving a more accurate progress of the parent task.
  • the progress of the parent task is equally divided according to the number of subtasks, and the defects of the subtask completion cannot be accurately reflected.
  • step S203 the maximum execution time of each subtask is divided into a plurality of time slices.
  • the maximum execution time of each subtask is divided into several time slices. In general, the duration of each time slice is less than the maximum execution time of the subtask. In this embodiment, the following two methods are used to divide the maximum execution time of each subtask:
  • the first method is to divide the maximum execution time of each subtask by setting the number of time slices, and specifically adopt the following steps:
  • the number of time slices of each subtask may be the same, that is, the maximum execution time of each subtask is equally divided into time slices of the first threshold.
  • the maximum execution time of the first subtask is 30 minutes, and the maximum execution time of the second subtask is 40 minutes.
  • the first threshold is set to 5, that is, the number of time slices is 5, then the maximum execution time of the first subtask is The average is divided into 5 time slices, and the time length of each time slice is 6 minutes; the maximum execution time of the second subtask is divided into 5 time slices, and the time length of each time slice is 8 minutes.
  • the number of time slices per subtask can also be different.
  • the number of time slices can be set according to actual needs. For example, the number of time slices of the first subtask is 5, and the number of time slices of the second subtask is 6. This is for illustrative purposes only and does not have any limiting effect.
  • the second method mainly divides the maximum execution time of each subtask by setting the time length of the time slice, and specifically adopts the following steps:
  • the length of time for setting the time slice is the second threshold.
  • the time length of the time slice can be set according to actual needs.
  • the time length of the time slice can be set to 5 minutes or 7 minutes, which is merely an example and does not have any limiting effect.
  • the obtained time slices have the same length of time.
  • the number of time slices may be the same or different, depending on the maximum execution time of each subtask.
  • the maximum execution time of the first subtask is 30 minutes, and the maximum execution time of the second subtask is 40 minutes.
  • the length of the time slice is set to 5, and the maximum execution time of the first subtask is divided into time lengths. For a 5 minute time slice, 6 time slices are obtained; the maximum execution time of the second subtask is divided into time slices of 5 minutes in length, and 8 time slices are obtained.
  • Step S204 segmenting the percentage progress corresponding to each subtask, and obtaining a percentage progress corresponding to each time slice.
  • the percentage progress corresponding to each subtask is segmented. Specifically, the percentage progress corresponding to each subtask is equally divided according to the number of time slices, and the percentage progress corresponding to each time slice is obtained.
  • Step S205 during the execution of the subtask, detecting whether the execution time of the subtask reaches the time corresponding to any time slice, and if yes, executing step S206; if not, waiting.
  • the execution time of the subtask can be calculated by setting a timer.
  • the timer is used to detect whether the execution time of the subtask reaches the time corresponding to any time slice, and according to the detection result, it is determined whether the percentage progress corresponding to the time slice is updated in the progress of the parent task. If the execution time of the subtask reaches the time corresponding to any time slice, the percentage progress corresponding to the time slice is updated in the progress of the parent task; if the execution time of the subtask does not reach the time corresponding to any time slice, the subtask is continued. Wait for the time corresponding to any time slice to arrive.
  • Step S206 updating the percentage progress corresponding to the time slice in the progress of the parent task.
  • step S205 After detecting that the execution time of the subtask reaches the time corresponding to any time slice according to step S205, the percentage progress corresponding to the time slice is updated in the progress of the parent task.
  • Step S207 after detecting the end of execution of any subtask, detecting whether the execution time of any subtask is the maximum execution time of the subtask, and if not, executing step S208.
  • the flag for ending the subtask execution is a message that the execution of the task sent by the subtask execution process ends. After receiving the message, it can be judged that the subtask execution ends. Determining the execution time of the subtask according to the set timer, and comparing the subtask execution time with the maximum execution time of the subtask, detecting whether the execution time of any subtask is the maximum execution time of the subtask, if the subtask The execution time of the subtask is not the maximum execution time of the subtask, indicating that the execution time of the subtask is less than the maximum execution time, that is, the time corresponding to the time slice is not all executed, and the percentage progress corresponding to the subtask is not updated. Finish.
  • the execution time of any subtask is the maximum execution time of the subtask
  • the time slice after the division in step S203 has been completely executed, that is, the execution time of the subtask has been detected to have reached all the time slices.
  • the percentage progress corresponding to all the time slices of the subtask is updated in the progress of the parent task, that is, the percentage progress corresponding to the subtask is updated in the progress of the parent task.
  • Step S208 supplementing the percentage progress of the subtask in the progress of the parent task to update the progress of the parent task.
  • the percentage progress of the subtask is supplemented in the progress of the parent task to update the progress of the parent task.
  • the execution time of the parent task is calculated according to the maximum execution time of the plurality of subtasks, and the ratio of the maximum execution time of each subtask to the execution time of the parent task is determined according to the ratio of the execution time of each subtask to the parent task.
  • the percentage is determined to determine the percentage progress of each subtask, so that the progress of the parent task is more accurately divided, and the progress of the parent task is divided according to the number of subtasks in the prior art, and the progress of the parent task cannot be accurately reflected.
  • the maximum execution time of each subtask is divided into a plurality of time slices, and the percentage progress corresponding to each subtask is divided to obtain a percentage progress corresponding to each time slice, and the subtask is detected during the execution of the subtask Whether the execution time reaches the time corresponding to any time slice, and if so, updates the percentage progress corresponding to the time slice in the progress of the parent task, and detects any subtask execution After the end of the line, it is detected whether the execution time of any subtask is the maximum execution time of the subtask, and if not, the percentage progress of the subtask is supplemented in the progress of the parent task to update the progress of the parent task, thereby overcoming a certain sub
  • the execution time of the task is too long, and the percentage progress of the subtask is updated in the progress of the parent task after the execution of the subtask. It is easy to cause the illusion that the task is not executed, and the user mistakenly believes that the task is not updated and the defect of the task execution process is erroneously cut off
  • FIG. 3 is a block diagram showing the structure of a parent task progress updating apparatus according to an embodiment of the present invention.
  • the parent task includes multiple subtasks.
  • the apparatus includes: a computing module 300, a determining module 310, and a complementing module 320.
  • the calculation module 300 is adapted to calculate a maximum execution time of each of the plurality of subtasks separately.
  • the maximum execution time refers to the maximum time required to perform a task to ensure that the task can be fully executed during the time period.
  • the determining module 310 is adapted to divide the progress of the parent task according to the maximum execution time of each subtask, and determine a percentage progress corresponding to each subtask.
  • the parent task contains multiple subtasks. After each subtask is executed, the percentage progress corresponding to the subtask is updated in the progress of the parent task. That is to say, the progress of the update of the parent task can intuitively reflect the completion of the task. In this embodiment, in order to more accurately represent the completion of the subtask in the progress of the parent task, the progress of the parent task is divided according to the maximum execution time of each subtask.
  • the specific performance is that the maximum execution time of the subtask is short, the smaller the percentage of the progress of the parent task, the longer the maximum execution time of the subtask, and the greater the percentage of the progress of the parent task, so that the more accurate
  • the division of the parent task progress overcomes the defect that the progress of the parent task is equally divided according to the number of subtasks in the prior art, and the defect of the progress of the parent task cannot be accurately reflected.
  • the complement module 320 is adapted to, during the execution of the subtask, if the execution of any subtask is detected, the percentage progress of the subtask is supplemented in the progress of the parent task to update the progress of the parent task.
  • the flag for ending the execution of the subtask is a message that the execution of the task sent by the subtask execution process ends. After receiving the message, the subtask execution end is judged, and the percentage progress of the subtask is supplemented in the progress of the parent task. To update the progress of the parent task.
  • the maximum execution time of each of the plurality of subtasks is separately calculated, and the progress of the parent task is divided according to the maximum execution time of each subtask. Determine the percentage progress corresponding to each subtask.
  • the percentage progress of the subtask is supplemented in the progress of the parent task to update the progress of the parent task, thereby accurately
  • the progress of the parent task is divided, and the completion of the subtask is more accurately reflected in the progress of the parent task, which overcomes the defect that the progress of the parent task is equally divided according to the number of subtasks in the prior art, and the progress of the parent task cannot be accurately reflected.
  • FIG. 4 is a block diagram showing the structure of a parent task progress updating apparatus according to another embodiment of the present invention.
  • the parent task includes multiple subtasks.
  • the apparatus includes: a calculation module 400, a determination module 410, and a complement module 420.
  • the calculation module 400 is adapted to calculate a maximum execution time of each of the plurality of subtasks.
  • the determining module 410 is adapted to divide the progress of the parent task according to the maximum execution time of each subtask, and determine a percentage progress corresponding to each subtask.
  • the complementing module 420 is adapted to, during the execution of the subtask, if any subtask execution is detected, the percentage progress of the subtask is supplemented in the progress of the parent task to update the progress of the parent task.
  • the determining module 410 further includes: a calculating unit 411 and a determining unit 412.
  • the calculating unit 411 is adapted to calculate an execution time of the parent task according to a maximum execution time of the plurality of subtasks.
  • the execution time of the parent task is the sum of the maximum execution times of the plurality of subtasks.
  • the execution time of the parent task can be calculated according to the maximum execution time of each subtask calculated by the calculation module 400.
  • the determining unit 412 is adapted to determine, according to the ratio of the maximum execution time of each subtask to the execution time of the parent task, the percentage of each subtask in the progress of the parent task to determine a percentage progress corresponding to each subtask.
  • the percentage progress for each subtask is the percentage progress from the sum of the percentage of the subtask's progress to the parent's task and the percentage of the subtasks that have been executed sequentially before the subtask. That is, the percentage progress of the second subtask is the percentage of the second subtask as a percentage of the progress of the parent task and the percentage of the first subtask as a percentage of the progress of the parent task. And get the percentage progress.
  • the apparatus further includes a segmentation module 430, a detection module 440, and an update module 450.
  • the segmentation module 430 is configured to divide the maximum execution time of each subtask into a plurality of time slices; and divide the percentage progress corresponding to each subtask to obtain a percentage progress corresponding to each time slice.
  • the segmentation module 430 further includes: a setting unit 431 and a segmentation unit 432.
  • the maximum execution time of a subtask is split by two partitioning methods:
  • the setting unit 431 is adapted to set the number of time slices of each subtask to be a first threshold.
  • the segmentation unit 432 is configured to divide the maximum execution time of each sub-task into a time slice of the first threshold, and divide the percentage progress corresponding to each sub-task to obtain a percentage progress corresponding to each time slice.
  • the number of time slices of each subtask may be the same, that is, the maximum execution time of each subtask is equally divided into time slices whose number is the first threshold.
  • the maximum execution time of the first subtask is 30 minutes, and the maximum execution time of the second subtask is 40 minutes.
  • the first threshold is set to 5, that is, the number of time slices is 5, then the maximum execution of the first subtask is performed.
  • the time average is divided into 5 time slices, and the time length of each time slice is 6 minutes; the maximum execution time of the second subtask is divided into 5 time slices, and the time length of each time slice is 8 minutes.
  • the number of time slices per subtask can also be different.
  • the number of time slices can be set according to actual needs. For example, the number of time slices of the first subtask is 5, and the number of time slices of the second subtask is 6. This is for illustrative purposes only and does not have any limiting effect.
  • the setting unit 431 is adapted to set the time length of the time slice to be the second threshold.
  • the time length of the time slice can be set according to actual needs.
  • the time slice can be set to 5 minutes or 7 minutes. This is for illustrative purposes only and does not have any limiting effect.
  • the dividing unit 432 is configured to divide the maximum execution time of each subtask into a plurality of time slices whose time length is the second threshold, and divide the percentage progress corresponding to each subtask to obtain a percentage progress corresponding to each time slice. .
  • the obtained time slices after dividing the maximum execution time of each subtask, the obtained time slices have the same length of time.
  • the number of time slices may be the same or different, depending on the maximum execution time of each subtask.
  • the maximum execution time of the first subtask is 30 minutes, and the maximum execution time of the second subtask is 40 minutes.
  • the length of the time slice is set to 5, and the maximum execution time of the first subtask is divided into time lengths. For a 5 minute time slice, 6 time slices are obtained; the maximum execution time of the second subtask is divided into time slices of 5 minutes in length, and 8 time slices are obtained.
  • the detecting module 440 is adapted to detect, during the execution of the subtask, whether the execution time of the subtask reaches the time corresponding to any time slice.
  • the update module 450 is adapted to update the percentage progress corresponding to the time slice in the progress of the parent task in the case of detecting whether the execution time of the subtask reaches the time corresponding to any time slice.
  • the complementing module 420 is further adapted to: after detecting the execution of any subtask, detecting whether the execution time of any subtask is the maximum execution time of the subtask, and if not, compiling the corresponding subtask in the progress of the parent task The percentage progress to update the progress of the parent task.
  • the execution time of the parent task is calculated according to the maximum execution time of the plurality of subtasks, and the ratio of the maximum execution time of each subtask to the execution time of the parent task is determined.
  • the percentage is determined to determine the percentage progress of each subtask, so that the progress of the parent task is more accurately divided, and the progress of the parent task is divided according to the number of subtasks in the prior art, and the progress of the parent task cannot be accurately reflected.
  • the maximum execution time of each subtask is divided into a plurality of time slices, and the percentage progress corresponding to each subtask is divided to obtain a percentage progress corresponding to each time slice, and the subtask is detected during the execution of the subtask Whether the execution time reaches the time corresponding to any time slice, and if so, updates the percentage progress corresponding to the time slice in the progress of the parent task, and detects the execution time of any sub-task after detecting the execution of any sub-task Whether it is the maximum execution time of the subtask, if not, then the parent In the progress, the percentage progress of the subtask is supplemented to update the progress of the parent task, thereby overcoming the execution time of a subtask is too long, and the percentage progress of the subtask is updated in the progress of the parent task after the execution of the subtask is completed.
  • modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment.
  • the modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components.
  • any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the device are combined.
  • Each feature disclosed in this specification (including the accompanying claims, the abstract and the drawings) may be replaced by alternative features that provide the same, equivalent or similar purpose.
  • Various component embodiments of the present invention may be implemented in hardware or in one or more processes Implemented by software modules running on the device, or in combinations of them.
  • a microprocessor or digital signal processor may be used in practice to implement some or all of the functionality of some or all of the components of the parent task progress update device in accordance with embodiments of the present invention.
  • the invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
  • a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
  • Figure 5 illustrates a computing device that can implement a parent task progress update method in accordance with the present invention.
  • the computing device conventionally includes a processor 510 and a computer program product or computer readable medium in the form of a storage device 520.
  • Storage device 520 can be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • Storage device 520 has a storage space 530 that stores program code 531 for performing any of the method steps described above.
  • storage space 530 storing program code may include various program code 531 for implementing various steps in the above methods, respectively.
  • the program code can be read from or written to one or more computer program products.
  • These computer program products include program code carriers such as a hard disk, a compact disk (CD), a memory card, or a floppy disk.
  • a computer program product is typically a portable or fixed storage unit such as that shown in FIG.
  • the storage unit may have storage segments, storage spaces, and the like that are similarly arranged to storage device 520 in the computing device of FIG.
  • the program code can be compressed, for example, in an appropriate form.
  • the storage unit comprises computer readable code 531 ' for performing the steps of the method according to the invention, ie code that can be read by a processor such as 510, which when executed by the computing device causes the computing device Perform the various steps in the method described above.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

A parent task progress update method and apparatus, wherein a parent task contains a plurality of sub-tasks. The method comprises: respectively calculating the maximum execution time of each sub-task of a plurality of sub-tasks (S100); dividing the progress of a parent task according to the maximum execution time of each sub-task to determine the progress percentage corresponding to each sub-task (S101); and during a sub-task execution process, if it is detected that the execution of any of the sub-tasks has finished, adding the progress percentage corresponding to the sub-task to the parent task progress to update the parent task progress (S102).

Description

父任务进度更新方法及装置Parent task progress update method and device
相关申请的交叉参考Cross-reference to related applications
本申请主张在2015年9月16日在中国提交的中国专利申请No.201510591617.X的优先权,其全部内容通过引用包含于此。The present application claims priority to Chinese Patent Application No. 201510591617.X filed on Sep. 16, 2015, the entire content of which is hereby incorporated by reference.
技术领域Technical field
本发明涉及互联网技术领域,具体涉及一种父任务进度更新方法及装置。The present invention relates to the field of Internet technologies, and in particular, to a parent task progress update method and apparatus.
背景技术Background technique
一般情况下,父任务是由多个子任务组成的。根据子任务的数量,对父任务的进度进行等分,在子任务执行结束后,在父任务的进度条中更新该子任务对应的进度。然而,多个子任务的执行时间一般不同,为多个子任务分配相同的百分比进度,并不能准确体现更新进度、任务完成情况,即,执行时间很短的子任务和执行时间很长的子任务,在执行结束后更新的父任务的进度量相同,不能准确体现任务进展情况。In general, a parent task consists of multiple subtasks. According to the number of subtasks, the progress of the parent task is equally divided. After the subtask execution ends, the progress corresponding to the subtask is updated in the progress bar of the parent task. However, the execution time of multiple subtasks is generally different. Assigning the same percentage progress to multiple subtasks does not accurately reflect the update progress and task completion status, that is, subtasks with short execution time and subtasks with long execution time. The progress of the parent task updated after the execution is the same, which does not accurately reflect the progress of the task.
举例来说,某个父任务由10个子任务组成,每个子任务的占父任务进度的百分比被等分为10%。也就是说,当一个子任务执行结束后,父任务的进度条更新10%的进度。如果第1-9个子任务的执行时间较短,第10个子任务的执行时间超过前9个子任务执行的总时间,那么父任务的进度很快更新到90%,而最后10%的进度迟迟不能更新。而对于用户来说,当父任务进度更新到90%时,用户认为任务即将结束。然而剩余10%的进度迟迟不能更新使用户误以为任务卡死,导致用户重新执行任务,造成系统资源浪费和用户时间浪费。For example, a parent task consists of 10 subtasks, and the percentage of each child task's progress toward the parent task is equally divided by 10%. That is, when a subtask is executed, the progress bar of the parent task is updated by 10%. If the execution time of the 1st-9th subtask is short, and the execution time of the 10th subtask exceeds the total execution time of the first 9 subtasks, the progress of the parent task is quickly updated to 90%, and the last 10% of the progress is delayed. Can't update. For the user, when the progress of the parent task is updated to 90%, the user thinks that the task is about to end. However, the remaining 10% of the progress can not be updated so that the user mistakenly believes that the task is stuck, causing the user to re-execute the task, resulting in wasted system resources and wasted user time.
发明内容Summary of the invention
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分 地解决上述问题的父任务进度更新方法和相应的父任务进度更新装置。In view of the above problems, the present invention has been made in order to provide an overcoming of the above problems or at least partially The parent task progress update method and the corresponding parent task progress update device for solving the above problem.
根据本发明的一个方面,提供了一种父任务进度更新方法,父任务包含多个子任务,方法包括:According to an aspect of the present invention, a parent task progress update method is provided. The parent task includes multiple subtasks, and the method includes:
分别计算多个子任务中每个子任务的最大执行时间;Calculating the maximum execution time of each of the plurality of subtasks separately;
根据每个子任务的最大执行时间,将父任务进度进行划分,确定每个子任务对应的百分比进度;According to the maximum execution time of each subtask, divide the progress of the parent task, and determine the percentage progress corresponding to each subtask;
在子任务执行过程中,若检测到任一子任务执行结束,则在父任务进度中补足该子任务对应的百分比进度以更新父任务进度。During the execution of the subtask, if the execution of any subtask is detected, the percentage progress of the subtask is supplemented in the progress of the parent task to update the progress of the parent task.
根据本发明的另一方面,提供了一种父任务进度更新装置,父任务包含多个子任务,装置包括:According to another aspect of the present invention, a parent task progress update apparatus is provided. The parent task includes a plurality of subtasks, and the apparatus includes:
计算模块,适于分别计算多个子任务中每个子任务的最大执行时间;a calculation module, configured to separately calculate a maximum execution time of each of the plurality of subtasks;
确定模块,适于根据每个子任务的最大执行时间,将父任务进度进行划分,确定每个子任务对应的百分比进度;The determining module is adapted to divide the progress of the parent task according to the maximum execution time of each subtask, and determine a percentage progress corresponding to each subtask;
补足模块,适于在子任务执行过程中,若检测到任一子任务执行结束,则在父任务进度中补足该子任务对应的百分比进度以更新父任务进度。The complement module is adapted to, during the execution of the subtask, if any subtask execution is detected, the percentage progress of the subtask is supplemented in the progress of the parent task to update the progress of the parent task.
根据本发明提供的方案,分别计算多个子任务中每个子任务的最大执行时间,根据每个子任务的最大执行时间,将父任务进度进行划分,确定每个子任务对应的百分比进度,在子任务执行过程中,若检测到任一子任务执行结束,则在父任务进度中补足该子任务对应的百分比进度以更新父任务进度,从而可以精确地对父任务进度进行划分,更准确的在父任务进度中体现子任务的完成情况,克服了现有技术中根据子任务数量将父任务进度等分,无法准确体现出父任务进展情况的缺陷。According to the solution provided by the present invention, the maximum execution time of each of the plurality of subtasks is separately calculated, and the progress of the parent task is divided according to the maximum execution time of each subtask, and the percentage progress corresponding to each subtask is determined, and the subtask execution is performed. During the process, if any sub-task execution is detected, the percentage progress of the sub-task is supplemented in the progress of the parent task to update the progress of the parent task, so that the progress of the parent task can be accurately divided, more accurately in the parent task. The progress of the subtask is reflected in the progress, which overcomes the defect that the progress of the parent task is equally divided according to the number of subtasks in the prior art, and the defect of the progress of the parent task cannot be accurately reflected.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solutions of the present invention, and the above-described and other objects, features and advantages of the present invention can be more clearly understood. Specific embodiments of the invention are set forth below.
附图说明DRAWINGS
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本 领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will be apparent to the present disclosure by reading the following detailed description of the preferred embodiments. Those of ordinary skill in the art will become apparent. The drawings are only for the purpose of illustrating the preferred embodiments and are not to be construed as limiting. Throughout the drawings, the same reference numerals are used to refer to the same parts. In the drawing:
图1示出了根据本发明一个实施例的父任务进度更新方法的流程图;1 shows a flow chart of a parent task progress update method in accordance with one embodiment of the present invention;
图2示出了根据本发明另一个实施例的父任务进度更新方法的流程图;2 is a flow chart showing a parent task progress update method according to another embodiment of the present invention;
图3示出了根据本发明一个实施例的父任务进度更新装置的结构框图;FIG. 3 is a block diagram showing the structure of a parent task progress updating apparatus according to an embodiment of the present invention; FIG.
图4示出了根据本发明另一个实施例的父任务进度更新装置的结构框图;4 is a block diagram showing the structure of a parent task progress updating apparatus according to another embodiment of the present invention;
图5示意性地示出了用于执行根据本发明实施例的父任务进度更新方法的计算设备的框图;以及FIG. 5 schematically illustrates a block diagram of a computing device for performing a parent task progress update method in accordance with an embodiment of the present invention;
图6示意性地示出了用于保持或者携带实现根据本发明实施例的父任务进度更新方法的程序代码的存储单元。Fig. 6 schematically shows a storage unit for holding or carrying program code implementing a parent task progress update method according to an embodiment of the present invention.
具体实施方式detailed description
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While the embodiments of the present invention have been shown in the drawings, the embodiments Rather, these embodiments are provided so that this disclosure will be more fully understood and the scope of the disclosure will be fully disclosed.
图1示出了根据本发明一个实施例的父任务进度更新方法的流程图。本实施例中的父任务包含多个子任务,如图1所示,该方法包括以下步骤:1 shows a flow chart of a parent task progress update method in accordance with one embodiment of the present invention. The parent task in this embodiment includes multiple subtasks. As shown in FIG. 1, the method includes the following steps:
步骤S100,分别计算多个子任务中每个子任务的最大执行时间。Step S100, respectively calculating a maximum execution time of each of the plurality of subtasks.
其中,最大执行时间指执行一任务所需的最长时间,以确保在该时间段内任务可以被全部执行完。Among them, the maximum execution time refers to the maximum time required to perform a task to ensure that the task can be fully executed during the time period.
步骤S101,根据每个子任务的最大执行时间,将父任务进度进行划分,确定每个子任务对应的百分比进度。Step S101, according to the maximum execution time of each subtask, divide the progress of the parent task, and determine the percentage progress corresponding to each subtask.
其中,父任务包含多个子任务,每个子任务执行结束后,都将在父任务进度中更新与该子任务对应的百分比进度,也就是说,父任务所更新的进度 可以直观地体现出任务的完成情况。本实施例为了更准确的在父任务进度中体现子任务的完成情况,采用了根据每个子任务的最大执行时间,对父任务进度进行划分。具体表现为,子任务的最大执行时间短,在父任务进度中所占的百分比越小,子任务的最大执行时间长,在父任务进度中所占的百分比越大,从而更为精确地将父任务进度进行划分,克服了现有技术中根据子任务数量将父任务进度等分,无法准确体现出父任务进展情况的缺陷。The parent task contains multiple subtasks. After each subtask is executed, the percentage progress corresponding to the subtask is updated in the progress of the parent task, that is, the progress of the parent task is updated. It can visually reflect the completion of the task. In this embodiment, in order to more accurately represent the completion of the subtask in the progress of the parent task, the progress of the parent task is divided according to the maximum execution time of each subtask. The specific performance is that the maximum execution time of the subtask is short, the smaller the percentage of the progress of the parent task, the longer the maximum execution time of the subtask, and the greater the percentage of the progress of the parent task, so that the more accurate The division of the parent task progress overcomes the defect that the progress of the parent task is equally divided according to the number of subtasks in the prior art, and the defect of the progress of the parent task cannot be accurately reflected.
步骤S102,在子任务执行过程中,若检测到任一子任务执行结束,则在父任务进度中补足该子任务对应的百分比进度以更新父任务进度。Step S102: During the execution of the subtask, if any subtask execution is detected, the percentage progress of the subtask is supplemented in the progress of the parent task to update the progress of the parent task.
其中,子任务执行结束的标志是子任务执行进程所发送的任务执行结束的消息。在接收到该消息后,即可判断子任务执行结束,在父任务进度中补足该子任务对应的百分比进度以更新父任务进度。The flag for ending the subtask execution is a message that the execution of the task sent by the subtask execution process ends. After receiving the message, it can be judged that the subtask execution ends, and the percentage progress of the subtask is supplemented in the progress of the parent task to update the progress of the parent task.
根据本发明上述实施例提供的方法,分别计算多个子任务中每个子任务的最大执行时间,根据每个子任务的最大执行时间,将父任务进度进行划分,确定每个子任务对应的百分比进度,在子任务执行过程中,若检测到任一子任务执行结束,则在父任务进度中补足该子任务对应的百分比进度以更新父任务进度,从而可以精确地对父任务进度进行划分,更准确的在父任务进度中体现子任务的完成情况,克服了现有技术中根据子任务数量将父任务进度等分,无法准确体现出父任务进展情况的缺陷。According to the method provided by the foregoing embodiment of the present invention, the maximum execution time of each of the plurality of subtasks is separately calculated, and the progress of the parent task is divided according to the maximum execution time of each subtask, and the percentage progress of each subtask is determined. During the execution of the subtask, if the execution of any subtask is detected, the percentage progress of the subtask is supplemented in the progress of the parent task to update the progress of the parent task, so that the progress of the parent task can be accurately divided, and more accurate. The completion of the subtask is reflected in the progress of the parent task, which overcomes the defect that the progress of the parent task is equally divided according to the number of subtasks in the prior art, and the defect of the progress of the parent task cannot be accurately reflected.
图2示出了根据本发明另一个实施例的父任务进度更新方法的流程图。如图2所示,该方法包括以下步骤:2 shows a flow chart of a parent task progress update method in accordance with another embodiment of the present invention. As shown in FIG. 2, the method includes the following steps:
步骤S200,分别计算多个子任务中每个子任务的最大执行时间。Step S200, respectively calculating a maximum execution time of each of the plurality of subtasks.
其中,最大执行时间指执行一任务所需的最长时间,以确保在该时间段内任务可以被全部执行完。Among them, the maximum execution time refers to the maximum time required to perform a task to ensure that the task can be fully executed during the time period.
步骤S201,根据多个子任务的最大执行时间计算父任务的执行时间。Step S201: Calculate the execution time of the parent task according to the maximum execution time of the plurality of subtasks.
具体地,父任务的执行时间为多个子任务的最大执行时间的总和。根据步骤S200中计算得到的每个子任务的最大执行时间可以计算得到父任务的执行时间。Specifically, the execution time of the parent task is the sum of the maximum execution times of the plurality of subtasks. The execution time of the parent task can be calculated according to the maximum execution time of each subtask calculated in step S200.
步骤S202,根据每个子任务的最大执行时间与父任务的执行时间的比值 确定每个子任务占父任务进度的百分比,以确定每个子任务对应的百分比进度。Step S202, according to the ratio of the maximum execution time of each subtask to the execution time of the parent task. Determine the percentage of each child task's progress toward the parent task to determine the percentage progress for each child task.
本实施例以多个子任务是顺序执行为例进行介绍,即在第一子任务执行结束后,执行第二子任务,第二子任务执行结束后,执行第三子任务,……,直至所有子任务执行结束。因此,本步骤中,每个子任务对应的百分比进度是该子任务占父任务进度的百分比和在该子任务之前已顺序执行的子任务占父任务进度的百分比之和得到的百分比进度,也就是说,第二子任务的百分比进度为第二子任务占父任务进度的百分比和第一子任务占父任务进度的百分比之和得到的百分比进度。In this embodiment, multiple subtasks are sequentially executed as an example, that is, after the first subtask is executed, the second subtask is executed, and after the second subtask is executed, the third subtask is executed, ... until all The subtask execution ends. Therefore, in this step, the percentage progress corresponding to each subtask is the percentage progress obtained by the sum of the subtask's percentage of the progress of the parent task and the percentage of the subtasks that have been sequentially executed before the subtask, which is the percentage of the progress of the parent task, that is, Say, the percentage progress of the second subtask is the percentage progress of the sum of the percentage of the second subtask in the progress of the parent task and the percentage of the first subtask in the progress of the parent task.
举例说明,父任务包含5个子任务,5个子任务的最大执行时间分别为30分钟、50分钟、15分钟、100分钟、6分钟,5个子任务的最大执行时间的总和为195分钟,即父任务的执行时间为196分钟。For example, the parent task contains 5 subtasks. The maximum execution time of the 5 subtasks is 30 minutes, 50 minutes, 15 minutes, 100 minutes, and 6 minutes. The sum of the maximum execution time of the 5 subtasks is 195 minutes, that is, the parent task. The execution time is 196 minutes.
第一子任务占父任务进度的百分比为:30/201=14.9%;The percentage of the first subtask to the progress of the parent task is: 30/201 = 14.9%;
第二子任务占父任务进度的百分比为:50/201=24.9%;The percentage of the second subtask to the progress of the parent task is: 50/201 = 24.9%;
第三子任务占父任务进度的百分比为:15/201=7.5%;The percentage of the third subtask to the progress of the parent task is: 15/201 = 7.5%;
第四子任务占父任务进度的百分比为:100/201=49.8%;The percentage of the fourth subtask to the progress of the parent task is: 100/201 = 49.8%;
第五子任务占父任务进度的百分比为:6/201=2.9%;The percentage of the fifth subtask to the progress of the parent task is: 6/201 = 2.9%;
得到,第一子任务的百分比进度为14.9%;第二子任务的百分比进度为39.8%(14.9%+24.9%);第三子任务的百分比进度为47.3%(14.9%+24.9%+7.5%);第四子任务的百分比进度为97.1%(14.9%+24.9%+7.5%+49.8%);第五子任务的百分比进度为100%(14.9%+24.9%+7.5%+49.8%+2.9%);这里仅仅是举例,不具有任何限定作用。The percentage progress of the first subtask is 14.9%; the percentage progress of the second subtask is 39.8% (14.9%+24.9%); the percentage progress of the third subtask is 47.3% (14.9%+24.9%+7.5%) The percentage progress of the fourth subtask is 97.1% (14.9%+24.9%+7.5%+49.8%); the percentage progress of the fifth subtask is 100% (14.9%+24.9%+7.5%+49.8%+2.9) %); here is just an example and does not have any limiting effect.
每个子任务的最大执行时间不同,根据每个子任务的最大执行时间与父任务的执行时间的比值确定每个子任务占父任务进度的百分比,进而确定每个子任务对应的百分比进度,从而保证了子任务的最大执行时间越短,在父任务进度中所占的百分比越小,子任务的最大执行时间长,在父任务进度中所占的百分比越大,实现了更为精确地将父任务进度进行划分,克服了现有 技术中根据子任务数量将父任务进度等分,无法准确体现出子任务完成情况的缺陷。The maximum execution time of each subtask is different. According to the ratio of the maximum execution time of each subtask to the execution time of the parent task, the percentage of each subtask's progress of the parent task is determined, and then the percentage progress of each subtask is determined, thereby ensuring the child. The shorter the maximum execution time of the task, the smaller the percentage of the progress of the parent task, the longer the maximum execution time of the child task, and the greater the percentage of the progress of the parent task, achieving a more accurate progress of the parent task. Divided to overcome existing In the technology, the progress of the parent task is equally divided according to the number of subtasks, and the defects of the subtask completion cannot be accurately reflected.
步骤S203,将每个子任务的最大执行时间分割为数个时间片。In step S203, the maximum execution time of each subtask is divided into a plurality of time slices.
为了克服某一子任务执行时间过长,而子任务执行结束后才在父任务进度中更新该子任务对应的百分比进度,容易造成任务未执行的错觉,使用户误以为任务不更新而错误切断任务执行过程的问题,这里将每个子任务的最大执行时间分割为数个时间片。一般情况下,每个时间片的时长小于子任务的最大执行时间。本实施例主要采用以下两种方法分割每个子任务的最大执行时间:In order to overcome the long execution time of a sub-task, and the percentage progress of the sub-task is updated in the progress of the parent task after the execution of the sub-task, it is easy to cause the illusion that the task is not executed, so that the user mistakenly believes that the task is not updated and is incorrectly cut off. The problem of the task execution process, here the maximum execution time of each subtask is divided into several time slices. In general, the duration of each time slice is less than the maximum execution time of the subtask. In this embodiment, the following two methods are used to divide the maximum execution time of each subtask:
方法一、主要是通过设定时间片的数量来对每个子任务的最大执行时间进行分割,具体采用以下步骤:The first method is to divide the maximum execution time of each subtask by setting the number of time slices, and specifically adopt the following steps:
设定每个子任务的时间片数量为第一阈值。Set the number of time slices for each subtask to the first threshold.
本方法中,每个子任务的时间片数量可以是相同的,即将每个子任务的最大执行时间都平均分割为数量为第一阈值的时间片。以第一子任务最大执行时间为30分钟,第二子任务最大执行时间为40分钟为例,设定第一阈值为5,即时间片数量为5,那么将第一子任务的最大执行时间平均分割成5个时间片,每个时间片的时间长度为6分钟;将第二子任务的最大执行时间平均分割成5个时间片,每个时间片的时间长度为8分钟。In the method, the number of time slices of each subtask may be the same, that is, the maximum execution time of each subtask is equally divided into time slices of the first threshold. For example, the maximum execution time of the first subtask is 30 minutes, and the maximum execution time of the second subtask is 40 minutes. The first threshold is set to 5, that is, the number of time slices is 5, then the maximum execution time of the first subtask is The average is divided into 5 time slices, and the time length of each time slice is 6 minutes; the maximum execution time of the second subtask is divided into 5 time slices, and the time length of each time slice is 8 minutes.
可选地,每个子任务的时间片数量也可以不同。时间片数量可以根据实际需要进行设定,例如,设定第一子任务的时间片数量为5,第二子任务的时间片数量为6。这里仅仅是举例说明,不具有任何限定作用。Optionally, the number of time slices per subtask can also be different. The number of time slices can be set according to actual needs. For example, the number of time slices of the first subtask is 5, and the number of time slices of the second subtask is 6. This is for illustrative purposes only and does not have any limiting effect.
方法二、主要是通过设定时间片的时间长度来对每个子任务的最大执行时间进行分割,具体采用以下步骤:The second method mainly divides the maximum execution time of each subtask by setting the time length of the time slice, and specifically adopts the following steps:
设定时间片的时间长度为第二阈值。The length of time for setting the time slice is the second threshold.
本方法中,时间片的时间长度可以根据实际需要进行设定。例如,可以设定时间片的时间长度为5分钟,也可以设定为7分钟,这里仅仅是举例说明,不具有任何限定作用。In this method, the time length of the time slice can be set according to actual needs. For example, the time length of the time slice can be set to 5 minutes or 7 minutes, which is merely an example and does not have any limiting effect.
将每个子任务的最大执行时间分割为时间长度为第二阈值的数个时间 片。Divide the maximum execution time of each subtask into several times of time with the second threshold sheet.
在本方法中,在对每个子任务的最大执行时间进行分割后,得到的时间片的时间长度相等。但时间片的数量可能相同,也可能不同,主要取决于每个子任务的最大执行时间。In the method, after the maximum execution time of each subtask is divided, the obtained time slices have the same length of time. However, the number of time slices may be the same or different, depending on the maximum execution time of each subtask.
以第一子任务最大执行时间为30分钟,第二子任务最大执行之间为40分钟为例,设定时间片的时间长度为5,将第一子任务的最大执行时间平均分割成时间长度为5分钟的时间片,得到6个时间片;第二子任务的最大执行时间平均分割成时间长度为5分钟的时间片,得到8个时间片。The maximum execution time of the first subtask is 30 minutes, and the maximum execution time of the second subtask is 40 minutes. The length of the time slice is set to 5, and the maximum execution time of the first subtask is divided into time lengths. For a 5 minute time slice, 6 time slices are obtained; the maximum execution time of the second subtask is divided into time slices of 5 minutes in length, and 8 time slices are obtained.
步骤S204,对每个子任务对应的百分比进度进行分割,得到每个时间片对应的百分比进度。Step S204, segmenting the percentage progress corresponding to each subtask, and obtaining a percentage progress corresponding to each time slice.
根据步骤S203中得到的时间片的数量,对每个子任务对应的百分比进度进行分割。具体地,根据时间片的数量将每个子任务对应的百分比进度平均分割,得到每个时间片对应的百分比进度。According to the number of time slices obtained in step S203, the percentage progress corresponding to each subtask is segmented. Specifically, the percentage progress corresponding to each subtask is equally divided according to the number of time slices, and the percentage progress corresponding to each time slice is obtained.
步骤S205,在子任务执行过程中,检测该子任务的执行时间是否到达任一时间片对应的时间,若是,则执行步骤S206;若否,则等待。Step S205, during the execution of the subtask, detecting whether the execution time of the subtask reaches the time corresponding to any time slice, and if yes, executing step S206; if not, waiting.
具体地,可以通过设置计时器来计算子任务的执行时间。根据计时器检测子任务的执行时间是否到达任一时间片对应的时间,并根据检测结果来确定是否在父任务进度中更新与该时间片对应的百分比进度。若子任务的执行时间到达任一时间片对应的时间,则在父任务进度中更新与该时间片对应的百分比进度;若子任务的执行时间未到达任一时间片对应的时间,则继续执行子任务,等待任一时间片对应的时间到达。Specifically, the execution time of the subtask can be calculated by setting a timer. The timer is used to detect whether the execution time of the subtask reaches the time corresponding to any time slice, and according to the detection result, it is determined whether the percentage progress corresponding to the time slice is updated in the progress of the parent task. If the execution time of the subtask reaches the time corresponding to any time slice, the percentage progress corresponding to the time slice is updated in the progress of the parent task; if the execution time of the subtask does not reach the time corresponding to any time slice, the subtask is continued. Wait for the time corresponding to any time slice to arrive.
步骤S206,在父任务进度中更新与该时间片对应的百分比进度。Step S206, updating the percentage progress corresponding to the time slice in the progress of the parent task.
根据步骤S205检测到子任务的执行时间到达任一时间片对应的时间后,在父任务进度中更新与该时间片对应的百分比进度。After detecting that the execution time of the subtask reaches the time corresponding to any time slice according to step S205, the percentage progress corresponding to the time slice is updated in the progress of the parent task.
在本实施例中,通过将每个子任务的最大执行时间进行分割,并根据分割后的数量对该子任务的百分比进度进行分割,在子任务的执行时间到达任一时间片对应的时间后,在父任务进度中更新与该时间片对应的百分比进度,从而克服了某一子任务执行时间过长,父任务进度一直未更新,造成任 务未执行的错觉,使用户误以为任务不更新而错误切断任务执行过程的问题。In this embodiment, by dividing the maximum execution time of each subtask, and dividing the percentage progress of the subtask according to the number of divisions, after the execution time of the subtask reaches the time corresponding to any time slice, Update the percentage progress corresponding to the time slice in the progress of the parent task, thereby overcoming the execution time of a certain sub-task is too long, and the progress of the parent task has not been updated, resulting in any The illusion that the service is not executed makes the user mistakenly think that the task is not updated and the problem of the task execution process is erroneously cut off.
步骤S207,在检测到任一子任务执行结束后,检测任一子任务的执行时间是否为该子任务的最大执行时间,若否,则执行步骤S208。Step S207, after detecting the end of execution of any subtask, detecting whether the execution time of any subtask is the maximum execution time of the subtask, and if not, executing step S208.
其中,子任务执行结束的标志是子任务执行进程所发送的任务执行结束的消息。在接收到该消息后,即可判断子任务执行结束。根据设定的计时器确定子任务的执行时间,并将子任务执行时间与该子任务的最大执行时间进行比较,检测任一子任务的执行时间是否为该子任务的最大执行时间,若子任务的执行时间不是该子任务的最大执行时间,则说明该子任务的执行时间小于最大执行时间,也就是说,时间片对应的时间并未被全部执行,该子任务对应的百分比进度并未更新完。The flag for ending the subtask execution is a message that the execution of the task sent by the subtask execution process ends. After receiving the message, it can be judged that the subtask execution ends. Determining the execution time of the subtask according to the set timer, and comparing the subtask execution time with the maximum execution time of the subtask, detecting whether the execution time of any subtask is the maximum execution time of the subtask, if the subtask The execution time of the subtask is not the maximum execution time of the subtask, indicating that the execution time of the subtask is less than the maximum execution time, that is, the time corresponding to the time slice is not all executed, and the percentage progress corresponding to the subtask is not updated. Finish.
在检测到任一子任务的执行时间为该子任务的最大执行时间的情况下,说明已全部执行完步骤S203中分割后的时间片,即,检测该子任务的执行时间已到达全部时间片对应的时间,在父任务进度中更新与该子任务的全部时间片对应的百分比进度,即在父任务进度中更新了该子任务对应的百分比进度。When it is detected that the execution time of any subtask is the maximum execution time of the subtask, it is explained that the time slice after the division in step S203 has been completely executed, that is, the execution time of the subtask has been detected to have reached all the time slices. Corresponding time, the percentage progress corresponding to all the time slices of the subtask is updated in the progress of the parent task, that is, the percentage progress corresponding to the subtask is updated in the progress of the parent task.
步骤S208,在父任务进度中补足该子任务对应的百分比进度以更新父任务进度。Step S208, supplementing the percentage progress of the subtask in the progress of the parent task to update the progress of the parent task.
在检测到任一子任务的执行时间小于该子任务的最大执行时间的情况下,在父任务进度中补足该子任务对应的百分比进度以更新父任务进度。In the case that it is detected that the execution time of any subtask is less than the maximum execution time of the subtask, the percentage progress of the subtask is supplemented in the progress of the parent task to update the progress of the parent task.
根据本发明上述实施例提供的方法,根据多个子任务的最大执行时间计算父任务的执行时间,根据每个子任务的最大执行时间与父任务的执行时间的比值确定每个子任务占父任务进度的百分比,以确定每个子任务对应的百分比进度,从而实现了更为精确地将父任务进度进行划分,克服了现有技术中根据子任务数量将父任务进度等分,无法准确体现出父任务进展情况的缺陷;将每个子任务的最大执行时间分割为数个时间片,对每个子任务对应的百分比进度进行分割,得到每个时间片对应的百分比进度,在子任务执行过程中,检测该子任务的执行时间是否到达任一时间片对应的时间,若是,则在父任务进度中更新与该时间片对应的百分比进度,在检测到任一子任务执 行结束后,检测任一子任务的执行时间是否为该子任务的最大执行时间,若否,则在父任务进度中补足该子任务对应的百分比进度以更新父任务进度,从而克服某一子任务执行时间过长,而子任务执行结束后才在父任务进度中更新该子任务对应的百分比进度,容易造成任务未执行的错觉,使用户误以为任务不更新而错误切断任务执行过程的缺陷。According to the method provided by the foregoing embodiment of the present invention, the execution time of the parent task is calculated according to the maximum execution time of the plurality of subtasks, and the ratio of the maximum execution time of each subtask to the execution time of the parent task is determined according to the ratio of the execution time of each subtask to the parent task. The percentage is determined to determine the percentage progress of each subtask, so that the progress of the parent task is more accurately divided, and the progress of the parent task is divided according to the number of subtasks in the prior art, and the progress of the parent task cannot be accurately reflected. The defect of the situation; the maximum execution time of each subtask is divided into a plurality of time slices, and the percentage progress corresponding to each subtask is divided to obtain a percentage progress corresponding to each time slice, and the subtask is detected during the execution of the subtask Whether the execution time reaches the time corresponding to any time slice, and if so, updates the percentage progress corresponding to the time slice in the progress of the parent task, and detects any subtask execution After the end of the line, it is detected whether the execution time of any subtask is the maximum execution time of the subtask, and if not, the percentage progress of the subtask is supplemented in the progress of the parent task to update the progress of the parent task, thereby overcoming a certain sub The execution time of the task is too long, and the percentage progress of the subtask is updated in the progress of the parent task after the execution of the subtask. It is easy to cause the illusion that the task is not executed, and the user mistakenly believes that the task is not updated and the defect of the task execution process is erroneously cut off. .
图3示出了根据本发明一个实施例的父任务进度更新装置的结构框图。本实施例中,父任务包含多个子任务,如图3所示,该装置包括:计算模块300、确定模块310和补足模块320。FIG. 3 is a block diagram showing the structure of a parent task progress updating apparatus according to an embodiment of the present invention. In this embodiment, the parent task includes multiple subtasks. As shown in FIG. 3, the apparatus includes: a computing module 300, a determining module 310, and a complementing module 320.
计算模块300,适于分别计算多个子任务中每个子任务的最大执行时间。The calculation module 300 is adapted to calculate a maximum execution time of each of the plurality of subtasks separately.
其中,最大执行时间指执行一任务所需的最长时间,以确保在该时间段内任务可以被全部执行完。Among them, the maximum execution time refers to the maximum time required to perform a task to ensure that the task can be fully executed during the time period.
确定模块310,适于根据每个子任务的最大执行时间,将父任务进度进行划分,确定每个子任务对应的百分比进度。The determining module 310 is adapted to divide the progress of the parent task according to the maximum execution time of each subtask, and determine a percentage progress corresponding to each subtask.
其中,父任务包含多个子任务,每个子任务执行结束后,都将在父任务进度中更新与该子任务对应的百分比进度。也就是说,父任务所更新的进度可以直观地体现出任务的完成情况。本实施例为了更准确的在父任务进度中体现子任务的完成情况,采用了根据每个子任务的最大执行时间,对父任务进度进行划分。具体表现为,子任务的最大执行时间短,在父任务进度中所占的百分比越小,子任务的最大执行时间长,在父任务进度中所占的百分比越大,从而更为精确地将父任务进度进行划分,克服了现有技术中根据子任务数量将父任务进度等分,无法准确体现出父任务进展情况的缺陷。The parent task contains multiple subtasks. After each subtask is executed, the percentage progress corresponding to the subtask is updated in the progress of the parent task. That is to say, the progress of the update of the parent task can intuitively reflect the completion of the task. In this embodiment, in order to more accurately represent the completion of the subtask in the progress of the parent task, the progress of the parent task is divided according to the maximum execution time of each subtask. The specific performance is that the maximum execution time of the subtask is short, the smaller the percentage of the progress of the parent task, the longer the maximum execution time of the subtask, and the greater the percentage of the progress of the parent task, so that the more accurate The division of the parent task progress overcomes the defect that the progress of the parent task is equally divided according to the number of subtasks in the prior art, and the defect of the progress of the parent task cannot be accurately reflected.
补足模块320,适于在子任务执行过程中,若检测到任一子任务执行结束,则在父任务进度中补足该子任务对应的百分比进度以更新父任务进度。The complement module 320 is adapted to, during the execution of the subtask, if the execution of any subtask is detected, the percentage progress of the subtask is supplemented in the progress of the parent task to update the progress of the parent task.
其中,子任务执行结束的标志是子任务执行进程所发送的任务执行结束的消息,在接收到该消息后,即可判断子任务执行结束,在父任务进度中补足该子任务对应的百分比进度以更新父任务进度。The flag for ending the execution of the subtask is a message that the execution of the task sent by the subtask execution process ends. After receiving the message, the subtask execution end is judged, and the percentage progress of the subtask is supplemented in the progress of the parent task. To update the progress of the parent task.
根据本发明上述实施例提供的装置,分别计算多个子任务中每个子任务的最大执行时间,根据每个子任务的最大执行时间,将父任务进度进行划分, 确定每个子任务对应的百分比进度,在子任务执行过程中,若检测到任一子任务执行结束,则在父任务进度中补足该子任务对应的百分比进度以更新父任务进度,从而可以精确地对父任务进度进行划分,更准确的在父任务进度中体现子任务的完成情况,克服了现有技术中根据子任务数量将父任务进度等分,无法准确体现出父任务进展情况的缺陷。According to the apparatus provided by the foregoing embodiment of the present invention, the maximum execution time of each of the plurality of subtasks is separately calculated, and the progress of the parent task is divided according to the maximum execution time of each subtask. Determine the percentage progress corresponding to each subtask. During the execution of the subtask, if any subtask execution is detected, the percentage progress of the subtask is supplemented in the progress of the parent task to update the progress of the parent task, thereby accurately The progress of the parent task is divided, and the completion of the subtask is more accurately reflected in the progress of the parent task, which overcomes the defect that the progress of the parent task is equally divided according to the number of subtasks in the prior art, and the progress of the parent task cannot be accurately reflected.
图4示出了根据本发明另一个实施例的父任务进度更新装置的结构框图。本实施例中,父任务包含多个子任务,如图4所示,该装置包括:计算模块400、确定模块410和补足模块420。FIG. 4 is a block diagram showing the structure of a parent task progress updating apparatus according to another embodiment of the present invention. In this embodiment, the parent task includes multiple subtasks. As shown in FIG. 4, the apparatus includes: a calculation module 400, a determination module 410, and a complement module 420.
计算模块400,适于分别计算多个子任务中每个子任务的最大执行时间。The calculation module 400 is adapted to calculate a maximum execution time of each of the plurality of subtasks.
确定模块410,适于根据每个子任务的最大执行时间,将父任务进度进行划分,确定每个子任务对应的百分比进度。The determining module 410 is adapted to divide the progress of the parent task according to the maximum execution time of each subtask, and determine a percentage progress corresponding to each subtask.
补足模块420,适于在子任务执行过程中,若检测到任一子任务执行结束,则在父任务进度中补足该子任务对应的百分比进度以更新父任务进度。The complementing module 420 is adapted to, during the execution of the subtask, if any subtask execution is detected, the percentage progress of the subtask is supplemented in the progress of the parent task to update the progress of the parent task.
其中,确定模块410进一步包括:计算单元411和确定单元412。The determining module 410 further includes: a calculating unit 411 and a determining unit 412.
计算单元411,适于根据多个子任务的最大执行时间计算父任务的执行时间。The calculating unit 411 is adapted to calculate an execution time of the parent task according to a maximum execution time of the plurality of subtasks.
具体地,父任务的执行时间为多个子任务的最大执行时间的总和。根据计算模块400计算得到的每个子任务的最大执行时间可以计算得到父任务的执行时间。Specifically, the execution time of the parent task is the sum of the maximum execution times of the plurality of subtasks. The execution time of the parent task can be calculated according to the maximum execution time of each subtask calculated by the calculation module 400.
确定单元412,适于根据每个子任务的最大执行时间与父任务的执行时间的比值确定每个子任务占父任务进度的百分比,以确定每个子任务对应的百分比进度。The determining unit 412 is adapted to determine, according to the ratio of the maximum execution time of each subtask to the execution time of the parent task, the percentage of each subtask in the progress of the parent task to determine a percentage progress corresponding to each subtask.
本实施例以多个子任务是顺序执行为例进行介绍,即在第一子任务执行结束后,执行第二子任务,第二子任务执行结束后,执行第三子任务,……,直至所有子任务执行结束。因此,每个子任务对应的百分比进度是该子任务占父任务进度的百分比和在该子任务之前已顺序执行的子任务占父任务进度的百分比之和得到的百分比进度。也就是说,第二子任务的百分比进度为第二子任务占父任务进度的百分比和第一子任务占父任务进度的百分比之 和得到的百分比进度。In this embodiment, multiple subtasks are sequentially executed as an example, that is, after the first subtask is executed, the second subtask is executed, and after the second subtask is executed, the third subtask is executed, ... until all The subtask execution ends. Therefore, the percentage progress for each subtask is the percentage progress from the sum of the percentage of the subtask's progress to the parent's task and the percentage of the subtasks that have been executed sequentially before the subtask. That is, the percentage progress of the second subtask is the percentage of the second subtask as a percentage of the progress of the parent task and the percentage of the first subtask as a percentage of the progress of the parent task. And get the percentage progress.
该装置还包括:分割模块430、检测模块440和更新模块450。The apparatus further includes a segmentation module 430, a detection module 440, and an update module 450.
其中,分割模块430,适于将每个子任务的最大执行时间分割为数个时间片;对每个子任务对应的百分比进度进行分割,得到每个时间片对应的百分比进度。The segmentation module 430 is configured to divide the maximum execution time of each subtask into a plurality of time slices; and divide the percentage progress corresponding to each subtask to obtain a percentage progress corresponding to each time slice.
可选地,分割模块430进一步包括:设定单元431和分割单元432。Optionally, the segmentation module 430 further includes: a setting unit 431 and a segmentation unit 432.
通过两种分割方式对子任务的最大执行时间进行分割:The maximum execution time of a subtask is split by two partitioning methods:
在第一种分割方式中,设定单元431,适于设定每个子任务的时间片数量为第一阈值。In the first division mode, the setting unit 431 is adapted to set the number of time slices of each subtask to be a first threshold.
分割单元432,适于将每个子任务的最大执行时间都平均分割为数量为第一阈值的时间片,以及,对每个子任务对应的百分比进度进行分割,得到每个时间片对应的百分比进度。The segmentation unit 432 is configured to divide the maximum execution time of each sub-task into a time slice of the first threshold, and divide the percentage progress corresponding to each sub-task to obtain a percentage progress corresponding to each time slice.
具体地,每个子任务的时间片数量可以是相同的,即将每个子任务的最大执行时间都平均分割为数量为第一阈值的时间片。以第一子任务最大执行时间为30分钟,第二子任务最大执行之间为40分钟为例,设定第一阈值为5,即时间片数量为5,那么将第一子任务的最大执行时间平均分割成5个时间片,每个时间片的时间长度为6分钟;将第二子任务的最大执行时间平均分割成5个时间片,每个时间片的时间长度为8分钟。Specifically, the number of time slices of each subtask may be the same, that is, the maximum execution time of each subtask is equally divided into time slices whose number is the first threshold. For example, the maximum execution time of the first subtask is 30 minutes, and the maximum execution time of the second subtask is 40 minutes. The first threshold is set to 5, that is, the number of time slices is 5, then the maximum execution of the first subtask is performed. The time average is divided into 5 time slices, and the time length of each time slice is 6 minutes; the maximum execution time of the second subtask is divided into 5 time slices, and the time length of each time slice is 8 minutes.
可选地,每个子任务的时间片数量也可以不同。时间片数量可以根据实际需要进行设定,例如,设定第一子任务的时间片数量为5,第二子任务的时间片数量为6。这里仅仅是举例说明,不具有任何限定作用。Optionally, the number of time slices per subtask can also be different. The number of time slices can be set according to actual needs. For example, the number of time slices of the first subtask is 5, and the number of time slices of the second subtask is 6. This is for illustrative purposes only and does not have any limiting effect.
在第二种分割方式中,设定单元431,适于设定时间片的时间长度为第二阈值。具体地,时间片的时间长度可以根据实际需要进行设定。例如,可以设定时间片的时间长度为5分钟,也可以设定为7分钟。这里仅仅是举例说明,不具有任何限定作用。In the second division mode, the setting unit 431 is adapted to set the time length of the time slice to be the second threshold. Specifically, the time length of the time slice can be set according to actual needs. For example, the time slice can be set to 5 minutes or 7 minutes. This is for illustrative purposes only and does not have any limiting effect.
分割单元432,适于将每个子任务的最大执行时间分割为时间长度为第二阈值的数个时间片,以及,对每个子任务对应的百分比进度进行分割,得到每个时间片对应的百分比进度。 The dividing unit 432 is configured to divide the maximum execution time of each subtask into a plurality of time slices whose time length is the second threshold, and divide the percentage progress corresponding to each subtask to obtain a percentage progress corresponding to each time slice. .
其中,在对每个子任务的最大执行时间进行分割后,得到的时间片的时间长度相等。但时间片的数量可能相同,也可能不同,主要取决于每个子任务的最大执行时间。Wherein, after dividing the maximum execution time of each subtask, the obtained time slices have the same length of time. However, the number of time slices may be the same or different, depending on the maximum execution time of each subtask.
以第一子任务最大执行时间为30分钟,第二子任务最大执行之间为40分钟为例,设定时间片的时间长度为5,将第一子任务的最大执行时间平均分割成时间长度为5分钟的时间片,得到6个时间片;第二子任务的最大执行时间平均分割成时间长度为5分钟的时间片,得到8个时间片。The maximum execution time of the first subtask is 30 minutes, and the maximum execution time of the second subtask is 40 minutes. The length of the time slice is set to 5, and the maximum execution time of the first subtask is divided into time lengths. For a 5 minute time slice, 6 time slices are obtained; the maximum execution time of the second subtask is divided into time slices of 5 minutes in length, and 8 time slices are obtained.
检测模块440,适于在子任务执行过程中,检测该子任务的执行时间是否到达任一时间片对应的时间。The detecting module 440 is adapted to detect, during the execution of the subtask, whether the execution time of the subtask reaches the time corresponding to any time slice.
更新模块450,适于在检测该子任务的执行时间是否到达任一时间片对应的时间的情况下,在父任务进度中更新与该时间片对应的百分比进度。The update module 450 is adapted to update the percentage progress corresponding to the time slice in the progress of the parent task in the case of detecting whether the execution time of the subtask reaches the time corresponding to any time slice.
补足模块420进一步适于:在检测到任一子任务执行结束后,检测任一子任务执行时间是否为该子任务的最大执行时间,若否,则在父任务进度中补足该子任务对应的百分比进度以更新父任务进度。The complementing module 420 is further adapted to: after detecting the execution of any subtask, detecting whether the execution time of any subtask is the maximum execution time of the subtask, and if not, compiling the corresponding subtask in the progress of the parent task The percentage progress to update the progress of the parent task.
根据本发明上述实施例提供的装置,根据多个子任务的最大执行时间计算父任务的执行时间,根据每个子任务的最大执行时间与父任务的执行时间的比值确定每个子任务占父任务进度的百分比,以确定每个子任务对应的百分比进度,从而实现了更为精确地将父任务进度进行划分,克服了现有技术中根据子任务数量将父任务进度等分,无法准确体现出父任务进展情况的缺陷;将每个子任务的最大执行时间分割为数个时间片,对每个子任务对应的百分比进度进行分割,得到每个时间片对应的百分比进度,在子任务执行过程中,检测该子任务的执行时间是否到达任一时间片对应的时间,若是,则在父任务进度中更新与该时间片对应的百分比进度,在检测到任一子任务执行结束后,检测任一子任务的执行时间是否为该子任务的最大执行时间,若否,则在父任务进度中补足该子任务对应的百分比进度以更新父任务进度,从而克服某一子任务执行时间过长,而子任务执行结束后才在父任务进度中更新该子任务对应的百分比进度,容易造成任务未执行的错觉,使用户误以为任务不更新而错误切断任务执行过程的缺陷。According to the foregoing embodiment of the present invention, the execution time of the parent task is calculated according to the maximum execution time of the plurality of subtasks, and the ratio of the maximum execution time of each subtask to the execution time of the parent task is determined. The percentage is determined to determine the percentage progress of each subtask, so that the progress of the parent task is more accurately divided, and the progress of the parent task is divided according to the number of subtasks in the prior art, and the progress of the parent task cannot be accurately reflected. The defect of the situation; the maximum execution time of each subtask is divided into a plurality of time slices, and the percentage progress corresponding to each subtask is divided to obtain a percentage progress corresponding to each time slice, and the subtask is detected during the execution of the subtask Whether the execution time reaches the time corresponding to any time slice, and if so, updates the percentage progress corresponding to the time slice in the progress of the parent task, and detects the execution time of any sub-task after detecting the execution of any sub-task Whether it is the maximum execution time of the subtask, if not, then the parent In the progress, the percentage progress of the subtask is supplemented to update the progress of the parent task, thereby overcoming the execution time of a subtask is too long, and the percentage progress of the subtask is updated in the progress of the parent task after the execution of the subtask is completed. The illusion that the task is not executed, the user mistakenly believes that the task is not updated and erroneously cuts off the defects of the task execution process.
在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固 有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithms and displays provided here are not tied to any particular computer, virtual system, or other device. Related. Various general purpose systems can also be used with the teaching based on the teachings herein. The structure required to construct such a system is apparent from the above description. Moreover, the invention is not directed to any particular programming language. It is to be understood that the invention may be embodied in a variety of programming language, and the description of the specific language has been described above in order to disclose the preferred embodiments of the invention.
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that the embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of the description.
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, the various features of the invention are sometimes grouped together into a single embodiment, in the above description of the exemplary embodiments of the invention, Figure, or a description of it. However, the method disclosed is not to be interpreted as reflecting the intention that the claimed invention requires more features than those recited in the claims. Rather, as the following claims reflect, inventive aspects reside in less than all features of the single embodiments disclosed herein. Therefore, the claims following the specific embodiments are hereby explicitly incorporated into the embodiments, and each of the claims as a separate embodiment of the invention.
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art will appreciate that the modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components. In addition to such features and/or at least some of the processes or units being mutually exclusive, any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the device are combined. Each feature disclosed in this specification (including the accompanying claims, the abstract and the drawings) may be replaced by alternative features that provide the same, equivalent or similar purpose.
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features that are included in other embodiments and not in other features, combinations of features of different embodiments are intended to be within the scope of the present invention. Different embodiments are formed and formed. For example, in the following claims, any one of the claimed embodiments can be used in any combination.
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理 器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的父任务进度更新装置中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。Various component embodiments of the present invention may be implemented in hardware or in one or more processes Implemented by software modules running on the device, or in combinations of them. Those skilled in the art will appreciate that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components of the parent task progress update device in accordance with embodiments of the present invention. The invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein. Such a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
例如,图5示出了可以实现根据本发明的父任务进度更新方法的计算设备。该计算设备传统上包括处理器510和以存储设备520形式的计算机程序产品或者计算机可读介质。存储设备520可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储设备520具有存储用于执行上述方法中的任何方法步骤的程序代码531的存储空间530。例如,存储程序代码的存储空间530可以包括分别用于实现上面的方法中的各种步骤的各个程序代码531。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘、紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为例如图6所示的便携式或者固定存储单元。该存储单元可以具有与图5的计算设备中的存储设备520类似布置的存储段、存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元包括用于执行根据本发明的方法步骤的计算机可读代码531',即可以由诸如510之类的处理器读取的代码,当这些代码由计算设备运行时,导致该计算设备执行上面所描述的方法中的各个步骤。For example, Figure 5 illustrates a computing device that can implement a parent task progress update method in accordance with the present invention. The computing device conventionally includes a processor 510 and a computer program product or computer readable medium in the form of a storage device 520. Storage device 520 can be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM. Storage device 520 has a storage space 530 that stores program code 531 for performing any of the method steps described above. For example, storage space 530 storing program code may include various program code 531 for implementing various steps in the above methods, respectively. The program code can be read from or written to one or more computer program products. These computer program products include program code carriers such as a hard disk, a compact disk (CD), a memory card, or a floppy disk. Such a computer program product is typically a portable or fixed storage unit such as that shown in FIG. The storage unit may have storage segments, storage spaces, and the like that are similarly arranged to storage device 520 in the computing device of FIG. The program code can be compressed, for example, in an appropriate form. Typically, the storage unit comprises computer readable code 531 ' for performing the steps of the method according to the invention, ie code that can be read by a processor such as 510, which when executed by the computing device causes the computing device Perform the various steps in the method described above.
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一 个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。 It is to be noted that the above-described embodiments are illustrative of the invention and are not intended to be limiting, and that the invention may be devised without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as a limitation. The word "comprising" does not exclude the presence of the elements or steps that are not recited in the claims. The word "a" or "an" The invention can be implemented by means of hardware comprising several distinct elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be the same A hardware item is embodied. The use of the words first, second, and third does not indicate any order. These words can be interpreted as names.

Claims (12)

  1. 一种父任务进度更新方法,所述父任务包含多个子任务,所述方法包括:A parent task progress update method, the parent task includes a plurality of subtasks, and the method includes:
    分别计算多个子任务中每个子任务的最大执行时间;Calculating the maximum execution time of each of the plurality of subtasks separately;
    根据每个子任务的最大执行时间,将父任务进度进行划分,确定每个子任务对应的百分比进度;According to the maximum execution time of each subtask, divide the progress of the parent task, and determine the percentage progress corresponding to each subtask;
    在子任务执行过程中,若检测到任一子任务执行结束,则在父任务进度中补足该子任务对应的百分比进度以更新父任务进度。During the execution of the subtask, if the execution of any subtask is detected, the percentage progress of the subtask is supplemented in the progress of the parent task to update the progress of the parent task.
  2. 根据权利要求1所述的方法,所述根据每个子任务的最大执行时间,将父任务进度进行划分,确定每个子任务对应的百分比进度进一步包括:The method according to claim 1, wherein the parent task progress is divided according to a maximum execution time of each subtask, and determining a percentage progress corresponding to each subtask further comprises:
    根据所述多个子任务的最大执行时间计算所述父任务的执行时间;Calculating an execution time of the parent task according to a maximum execution time of the plurality of subtasks;
    根据每个子任务的最大执行时间与所述父任务的执行时间的比值确定每个子任务占所述父任务进度的百分比,以确定每个子任务对应的百分比进度。A percentage of each subtask occupies the progress of the parent task is determined according to a ratio of a maximum execution time of each subtask to an execution time of the parent task, to determine a percentage progress corresponding to each subtask.
  3. 根据权利要求1或2所述的方法,在子任务执行过程中,若检测到任一子任务执行结束,则在父任务进度中补足该子任务对应的百分比进度以更新父任务进度之前,所述方法还包括:The method according to claim 1 or 2, wherein during the execution of the subtask, if the execution of any subtask is detected, the percentage progress of the subtask is supplemented in the progress of the parent task to update the progress of the parent task. The method also includes:
    将每个子任务的最大执行时间分割为数个时间片;Split the maximum execution time of each subtask into several time slices;
    对每个子任务对应的百分比进度进行分割,以得到每个时间片对应的百分比进度;Divide the percentage progress corresponding to each subtask to obtain the percentage progress corresponding to each time slice;
    在子任务执行过程中,检测该子任务的执行时间是否到达任一时间片对应的时间,若是,则在父任务进度中更新与该时间片对应的百分比进度。During the execution of the subtask, it is detected whether the execution time of the subtask reaches the time corresponding to any time slice, and if so, the percentage progress corresponding to the time slice is updated in the progress of the parent task.
  4. 根据权利要求3所述的方法,所述将每个子任务的最大执行时间分割为数个时间片进一步包括:The method according to claim 3, wherein the dividing the maximum execution time of each subtask into a plurality of time slices further comprises:
    设定每个子任务的时间片数量为第一阈值;Setting the number of time slices of each subtask to a first threshold;
    将每个子任务的最大执行时间都平均分割为数量为第一阈值的时间片。The maximum execution time of each subtask is equally divided into time slices whose number is the first threshold.
  5. 根据权利要求3所述的方法,所述将每个子任务的最大执行时间分 割为数个时间片进一步包括:The method of claim 3, wherein the maximum execution time of each subtask is divided Cutting into several time slices further includes:
    设定时间片的时间长度为第二阈值;Setting a time slice length is a second threshold;
    将每个子任务的最大执行时间分割为时间长度为第二阈值的数个时间片。The maximum execution time of each subtask is divided into a plurality of time slices whose time length is the second threshold.
  6. 根据权利要求3-5任一项所述的方法,所述在子任务执行过程中,若检测到任一子任务执行结束,则在父任务进度中补足该子任务对应的百分比进度以更新父任务进度进一步包括:The method according to any one of claims 3-5, wherein during the execution of the subtask, if the execution of any subtask is detected, the percentage progress of the subtask is supplemented in the progress of the parent task to update the parent. Task progress further includes:
    在检测到任一子任务执行结束后,检测任一子任务的执行时间是否为该子任务的最大执行时间,若否,则在父任务进度中补足该子任务对应的百分比进度以更新父任务进度。After detecting the execution of any subtask, it is detected whether the execution time of any subtask is the maximum execution time of the subtask, and if not, the percentage progress of the subtask is supplemented in the progress of the parent task to update the parent task. schedule.
  7. 一种父任务进度更新装置,所述父任务包含多个子任务,所述装置包括:A parent task progress update device, the parent task includes a plurality of subtasks, and the device includes:
    计算模块,适于分别计算多个子任务中每个子任务的最大执行时间;a calculation module, configured to separately calculate a maximum execution time of each of the plurality of subtasks;
    确定模块,适于根据每个子任务的最大执行时间,将父任务进度进行划分,确定每个子任务对应的百分比进度;The determining module is adapted to divide the progress of the parent task according to the maximum execution time of each subtask, and determine a percentage progress corresponding to each subtask;
    补足模块,适于在子任务执行过程中,若检测到任一子任务执行结束,则在父任务进度中补足该子任务对应的百分比进度以更新父任务进度。The complement module is adapted to, during the execution of the subtask, if any subtask execution is detected, the percentage progress of the subtask is supplemented in the progress of the parent task to update the progress of the parent task.
  8. 根据权利要求7所述的装置,所述确定模块进一步包括:The apparatus of claim 7, the determining module further comprising:
    计算单元,适于根据所述多个子任务的最大执行时间计算所述父任务的执行时间;a calculating unit, configured to calculate an execution time of the parent task according to a maximum execution time of the multiple subtasks;
    确定单元,适于根据每个子任务的最大执行时间与所述父任务的执行时间的比值确定每个子任务占所述父任务进度的百分比,以确定每个子任务对应的百分比进度。And a determining unit, configured to determine, according to a ratio of a maximum execution time of each subtask to an execution time of the parent task, a percentage of each subtask occupying the progress of the parent task to determine a percentage progress corresponding to each subtask.
  9. 根据权利要求7或8所述的装置,所述装置还包括:The device according to claim 7 or 8, the device further comprising:
    分割模块,适于将每个子任务的最大执行时间分割为数个时间片;对每个子任务对应的百分比进度进行分割,得到每个时间片对应的百分比进度;The segmentation module is configured to divide the maximum execution time of each subtask into a plurality of time slices; segment the percentage progress corresponding to each subtask, and obtain a percentage progress corresponding to each time slice;
    检测模块,适于在子任务执行过程中,检测该子任务的执行时间是否到 达任一时间片对应的时间;a detecting module, configured to detect, during the execution of the subtask, whether the execution time of the subtask is The time corresponding to any time slice;
    更新模块,适于在检测该子任务的执行时间是否到达任一时间片对应的时间的情况下,在父任务进度中更新与该时间片对应的百分比进度。The update module is adapted to update the percentage progress corresponding to the time slice in the progress of the parent task in the case of detecting whether the execution time of the subtask reaches the time corresponding to any time slice.
  10. 根据权利要求9所述的装置,所述分割模块进一步包括:The apparatus according to claim 9, wherein the segmentation module further comprises:
    设定单元,适于设定每个子任务的时间片数量为第一阈值;a setting unit, configured to set a number of time slices of each subtask as a first threshold;
    分割单元,适于将每个子任务的最大执行时间都平均分割为数量为第一阈值的时间片,以及,对每个子任务对应的百分比进度进行分割,得到每个时间片对应的百分比进度。The segmentation unit is configured to divide the maximum execution time of each subtask into a time slice with a quantity of the first threshold, and divide the percentage progress corresponding to each subtask to obtain a percentage progress corresponding to each time slice.
  11. 根据权利要求9所述的装置,所述分割模块进一步包括:The apparatus according to claim 9, wherein the segmentation module further comprises:
    设定单元,适于设定时间片的时间长度为第二阈值;a setting unit, configured to set a time slice length to a second threshold;
    分割单元,适于将每个子任务的最大执行时间分割为时间长度为第二阈值的数个时间片,以及,对每个子任务对应的百分比进度进行分割,得到每个时间片对应的百分比进度。The segmentation unit is configured to divide the maximum execution time of each subtask into a plurality of time slices whose time length is the second threshold, and divide the percentage progress corresponding to each subtask to obtain a percentage progress corresponding to each time slice.
  12. 根据权利要求9-11任一项所述的装置,所述补足模块进一步适于:A device according to any one of claims 9-11, the complement module further adapted to:
    在检测到任一子任务执行结束后,检测任一子任务的执行时间是否为该子任务的最大执行时间,若否,则在父任务进度中补足该子任务对应的百分比进度以更新父任务进度。 After detecting the execution of any subtask, it is detected whether the execution time of any subtask is the maximum execution time of the subtask, and if not, the percentage progress of the subtask is supplemented in the progress of the parent task to update the parent task. schedule.
PCT/CN2016/091586 2015-09-16 2016-07-25 Parent task progress update method and apparatus WO2017045482A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510591617.X 2015-09-16
CN201510591617.XA CN105260287A (en) 2015-09-16 2015-09-16 Method and device for updating parent task progress

Publications (1)

Publication Number Publication Date
WO2017045482A1 true WO2017045482A1 (en) 2017-03-23

Family

ID=55099987

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/091586 WO2017045482A1 (en) 2015-09-16 2016-07-25 Parent task progress update method and apparatus

Country Status (2)

Country Link
CN (1) CN105260287A (en)
WO (1) WO2017045482A1 (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105260287A (en) * 2015-09-16 2016-01-20 北京奇虎科技有限公司 Method and device for updating parent task progress
CN106325992A (en) * 2016-08-20 2017-01-11 国云科技股份有限公司 Method for calculating progress of long tasks in distributed type environment
CN106383704B (en) * 2016-08-31 2021-01-15 腾讯科技(深圳)有限公司 Progress bar data processing method and device
CN109426554B (en) * 2017-08-22 2020-10-09 中移(杭州)信息技术有限公司 Timing implementation method and device for server
CN110609735B (en) * 2018-06-15 2023-07-18 伊姆西Ip控股有限责任公司 Task management method, device and computer program product
CN110704517B (en) * 2018-06-21 2023-01-17 北京国双科技有限公司 Method and device for generating task, storage medium and processor
CN111078510B (en) * 2018-10-18 2023-05-16 北京国双科技有限公司 Task processing progress recording method and device
CN111219839A (en) * 2019-11-25 2020-06-02 珠海格力电器股份有限公司 Method and device for displaying on-off progress of unit and air conditioning equipment
CN112181795A (en) * 2020-10-15 2021-01-05 上海英方软件股份有限公司 Method and device for calculating overall progress of task
CN112950169A (en) * 2021-03-26 2021-06-11 深圳云之家网络有限公司 Task management method and device and computer storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102110015A (en) * 2009-12-29 2011-06-29 北大方正集团有限公司 Method and device for determining task progress and task processing time
CN103473345A (en) * 2013-09-23 2013-12-25 深圳市融创天下科技股份有限公司 Method of predicating time duration
CN103927228A (en) * 2013-01-15 2014-07-16 株式会社日立制作所 Job execution prediction method and job execution prediction device
CN105260287A (en) * 2015-09-16 2016-01-20 北京奇虎科技有限公司 Method and device for updating parent task progress

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6317774B1 (en) * 1997-01-09 2001-11-13 Microsoft Corporation Providing predictable scheduling of programs using a repeating precomputed schedule
CN104123214B (en) * 2013-04-26 2017-07-14 阿里巴巴集团控股有限公司 The method and system of tasks carrying progress metrics and displaying based on runtime data
CN103699473A (en) * 2013-12-13 2014-04-02 乐视网信息技术(北京)股份有限公司 Indicating method and device for task progress

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102110015A (en) * 2009-12-29 2011-06-29 北大方正集团有限公司 Method and device for determining task progress and task processing time
CN103927228A (en) * 2013-01-15 2014-07-16 株式会社日立制作所 Job execution prediction method and job execution prediction device
CN103473345A (en) * 2013-09-23 2013-12-25 深圳市融创天下科技股份有限公司 Method of predicating time duration
CN105260287A (en) * 2015-09-16 2016-01-20 北京奇虎科技有限公司 Method and device for updating parent task progress

Also Published As

Publication number Publication date
CN105260287A (en) 2016-01-20

Similar Documents

Publication Publication Date Title
WO2017045482A1 (en) Parent task progress update method and apparatus
US9990229B2 (en) Scheduling method and apparatus for applying laxity correction based on task completion proportion and preset time
JP6304694B2 (en) Reliability threshold-based counter-branch path execution for branch prediction
WO2017107843A1 (en) Periodic task processing method and apparatus, computer program, and readable medium
JP2019522836A5 (en)
JP2017533502A5 (en)
EP2437168A2 (en) Method and device for balancing load of multiprocessor system
JP2016511489A5 (en)
RU2015130617A (en) VEHICLE PARKING MANAGEMENT
US9965329B2 (en) Method and apparatus for workload placement on heterogeneous systems
JP2017530453A5 (en)
RU2016106637A (en) DECISION ON THE AVAILABILITY / LACK OF VOCALIZATION FOR SPEECH PROCESSING
US11182318B2 (en) Processor and interrupt controller
US20200150941A1 (en) Heterogenous computer system optimization
CN105893233B (en) Method and system for automatically testing firmware
JP2014127037A5 (en)
CN110555086A (en) Method and device for attributing resource points in grid
WO2017020762A1 (en) Apparatus, method, and computer program for utilizing secondary threads to assist primary threads in performing application tasks
WO2017020794A1 (en) Voice recognition method applicable to interactive system and device utilizing same
CN110162423B (en) Resource checking method and resource checking device
CN110971857B (en) Video playback method and device and computer readable storage medium
JP2014149846A5 (en)
KR20210025677A (en) Branch target buffer with initial return prediction
CN110663051A (en) Computerized system and method for resolving cross-vehicle dependencies in vehicle scheduling
US10908902B2 (en) Distance based branch prediction and detection of potential call and potential return instructions

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16845596

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16845596

Country of ref document: EP

Kind code of ref document: A1