Disclosure of Invention
In order to solve the technical problem, a time-consuming task management method and a time-consuming task management device for an information system are provided, which can efficiently run time-consuming tasks and improve the running efficiency of the information system.
In order to achieve the purpose of the invention, the invention provides a time-consuming task management method of an information system, which comprises the following steps:
when an instruction for starting the first time-consuming task is received, starting to run a master of the first time-consuming task, and creating a copy of the first time-consuming task in a time-consuming task container; the information system displays the state of the first time-consuming task in a list according to the original of the first time-consuming task;
and if an instruction for starting the second time-consuming task is received, running the original of the second time-consuming task, stopping running the original of the first time-consuming task, and running the copy of the first time-consuming task in the time-consuming task container.
In an optional embodiment, before starting the step of running the original of the first time-consuming task when receiving an instruction to start the first time-consuming task, the method further comprises:
learning known time-consuming tasks for an informatization system; wherein the known time consuming tasks include a first time consuming task and a second time consuming task.
In an alternative embodiment, the steps of running the original copy of the second time-consuming task, stopping running the original copy of the first time-consuming task, and running the copy of the first time-consuming task in the time-consuming task container include:
running a copy of the first time-consuming task in the time-consuming task container to obtain updated running data of the first time-consuming task until the first time-consuming task is determined to be completed according to the updated running data of the first time-consuming task;
assigning data of the first time-consuming task determined to be completed by the first time-consuming task to a time-consuming task storage area so as to update the original of the first time-consuming task in the time-consuming task storage area;
the copy of the first time consuming task is deleted.
In an alternative embodiment, running the original of the second time-consuming task, stopping running the original of the first time-consuming task, and running the copy of the first time-consuming task in the time-consuming task container comprises:
and if the copy of the first time-consuming task has errors during the operation, assigning the mark for marking the error occurrence of the time-consuming task to the original of the first time-consuming task, and deleting the copy of the first time-consuming task from the time-consuming task container.
In an optional embodiment, after the steps of running the original of the second time-consuming task, stopping running the original of the first time-consuming task, and running the copy of the first time-consuming task in the time-consuming task container, the method further comprises:
if an instruction for switching to the first time-consuming task is received, assigning a positive copy of the first time-consuming task by using the data of the copy of the first time-consuming task;
and rendering an entry corresponding to the first time-consuming task in the list of the information system according to the original book of the first time-consuming task.
In order to achieve the object of the present invention, the time-consuming task management device of an information system of the present invention includes a memory and a processor,
the memory is to store computer readable instructions;
the processor is configured to execute the computer-readable instructions to perform operations comprising:
when an instruction for starting the first time-consuming task is received, starting to run a master of the first time-consuming task, and creating a copy of the first time-consuming task in a time-consuming task container; the information system displays the state of the first time-consuming task in a list according to the original of the first time-consuming task;
and if an instruction for starting the second time-consuming task is received, running the original of the second time-consuming task, stopping running the original of the first time-consuming task, and running the copy of the first time-consuming task in the time-consuming task container.
In an alternative embodiment, before starting the operation of running the original of the first time-consuming task when receiving the instruction to start the first time-consuming task, the processor further performs the following operation:
learning known time-consuming tasks for an informatization system; wherein the known time consuming tasks include a first time consuming task and a second time consuming task.
In an alternative embodiment, running the original of the second time-consuming task, stopping running the original of the first time-consuming task, and running the copy of the first time-consuming task in the time-consuming task container comprises:
running a copy of the first time-consuming task in the time-consuming task container to obtain updated running data of the first time-consuming task until the first time-consuming task is determined to be completed according to the updated running data of the first time-consuming task;
assigning data of the first time-consuming task determined to be completed by the first time-consuming task to a time-consuming task storage area so as to update the original of the first time-consuming task in the time-consuming task storage area;
the copy of the first time consuming task is deleted.
In an alternative embodiment, running the original of the second time-consuming task, stopping running the original of the first time-consuming task, and running the copy of the first time-consuming task in the time-consuming task container comprises:
and if the copy of the first time-consuming task has errors during the operation, assigning the mark for marking the error occurrence of the time-consuming task to the original of the first time-consuming task, and deleting the copy of the first time-consuming task from the time-consuming task container.
In an alternative embodiment, after running the original of the second time-consuming task, stopping running the original of the first time-consuming task, and running the copy of the first time-consuming task in the time-consuming task container, the processor further performs the following operations:
if an instruction for switching to the first time-consuming task is received, assigning a positive copy of the first time-consuming task by using the data of the copy of the first time-consuming task;
and rendering an entry corresponding to the first time-consuming task in the list of the information system according to the original book of the first time-consuming task.
The embodiment of the invention has the advantages that the copy of the time-consuming task can be operated in the background by creating the copy for the time-consuming task which starts to operate in the container and operating the copy of the time-consuming task in a virtual machine mode; therefore, the time-consuming task displayed at the front end can not be influenced, and other time-consuming tasks can be continuously operated at the rear end, so that the operation efficiency of the information system is improved.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
The steps illustrated in the flow charts of the figures may be performed in a computer system such as a set of computer-executable instructions. Also, while a logical order is shown in the flow diagrams, in some cases, the steps shown or described may be performed in an order different than here.
In an information-based system, time-consuming tasks initiated and controlled by the front-end, such as uploading, resource deletion, and the like, are often performed. At present, most of systems still have the use logic that one time-consuming task interface is opened, and another time-consuming task interface is opened after the task is finished. This operation is time-consuming and reduces the operating efficiency of the user.
In order to solve the above technical problem, in one aspect, an embodiment of the present invention provides a time-consuming task management method for an information system, as shown in fig. 1, the method includes step S101 and step S103.
Step S101, when receiving an instruction for starting the first time-consuming task, starting to run the original of the first time-consuming task, and creating a copy of the first time-consuming task in the time-consuming task container.
The user instructs to start the first time-consuming task through the input device, and the information system receives an instruction for starting the first time-consuming task. At this time, the informatization system starts to run the original of the first time-consuming task, and according to the data obtained by running the original of the first time-consuming task, a displayed list is rendered at the front end of the informatization system, and the state of the first time-consuming task is displayed in the list. And after starting to run the original of the first time-consuming task, creating a copy of the first time-consuming task in the time-consuming task container. The time-consuming task container is used to run a copy of the first time-consuming task, and may also run copies of more time-consuming tasks. The container technology is a virtualization technology, can flexibly run various tasks in a virtual machine mode, is used for running time-consuming tasks, and can run copies of the time-consuming tasks in a background. Therefore, the time-consuming tasks displayed at the front end can not be influenced, and other time-consuming tasks can be continuously operated at the rear end.
Step S103, if an instruction for starting the second time-consuming task is received, running the original of the second time-consuming task, stopping running the original of the first time-consuming task, and running the copy of the first time-consuming task in the time-consuming task container.
In step S101, after the original of the first time-consuming task is run, and the copy of the first time-consuming task is created in the time-consuming task container, if an instruction to start the second time-consuming task is received, the second time-consuming task is displayed at the front end of the information-based system, the second time-consuming task is run to enable the second time-consuming task to be displayed at the front end, and the first time-consuming task is still kept running, the original of the second time-consuming task is run at this time, the original of the first time-consuming task is stopped running, and the copy of the first time-consuming task is run in the time-consuming task container.
The embodiment of the invention has the advantages that the copy of the time-consuming task can be operated in the background by creating the copy for the time-consuming task which starts to operate in the container and operating the copy of the time-consuming task in a virtual machine mode; therefore, the time-consuming task displayed at the front end can not be influenced, and other time-consuming tasks can be continuously operated at the rear end, so that the operation efficiency of the information system is improved.
In an optional embodiment, before step S101, the method further comprises:
learning known time-consuming tasks for an informatization system; wherein the known time consuming tasks include a first time consuming task and a second time consuming task.
In this case, the known time-consuming tasks of the information system can be obtained from the operating records of the previous tasks of the information system or from the type of the task. When the first time-consuming task is started, the first time-consuming task is confirmed to belong to the known time-consuming task, the original of the first time-consuming task is operated, and a copy of the first task is created in a time-consuming task container; and when the second time-consuming task is started, confirming that the second time-consuming task belongs to the known time-consuming task.
In an alternative embodiment, step S103 comprises:
running a copy of the first time-consuming task in the time-consuming task container to obtain updated running data of the first time-consuming task until the first time-consuming task is determined to be completed according to the updated running data of the first time-consuming task;
assigning data of the first time-consuming task determined to be completed by the first time-consuming task to a time-consuming task storage area so as to update the original of the first time-consuming task in the time-consuming task storage area;
the copy of the first time consuming task is deleted.
In this alternative embodiment, a copy of the first time-consuming task is run in the time-consuming task container. And if a plurality of copies of the time-consuming tasks are run in the time-consuming task container, sequentially and circularly running the copies of the time-consuming tasks. And running the copy of the first time-consuming task to obtain updated running data of the first time-consuming task. And if the copy of the first time-consuming task is determined to be operated and completed according to the updated operation data, assigning the original of the first time-consuming task to be used as the operation data of the first time-consuming task by adopting the operation data obtained when the operation of the copy of the first time-consuming task is completed. At this point, the copy of the first time-consuming task may be deleted because it is no longer running. When the state of the first time-consuming task needs to be displayed in the list, the state of the first time-consuming task may be displayed in the list according to the running data of the original of the first time-consuming task.
In an alternative embodiment, step S103 comprises:
and if the copy of the first time-consuming task has errors during the operation, assigning the mark for marking the error occurrence of the time-consuming task to the original of the first time-consuming task, and deleting the copy of the first time-consuming task from the time-consuming task container.
Since the copy of the first time-consuming task may have errors during running, when an error occurs, the tag marking the error occurred in the time-consuming task is assigned to the original of the first time-consuming task. When the state of the first time-consuming task needs to be displayed in the list, displaying the state of the first time-consuming task in the list as an error of the first time-consuming task.
In an optional embodiment, after step S103, the method further comprises:
if an instruction for switching to the first time-consuming task is received, assigning a positive copy of the first time-consuming task by using the data of the copy of the first time-consuming task;
and rendering an entry corresponding to the first time-consuming task in the list of the information system according to the original book of the first time-consuming task.
Since the informatization system switches to running the second time-consuming task in step S103, a copy of the first time-consuming task is run in the time-consuming task container. Thus, the running data of the copy of the first time consuming task is the fastest progressing running data of the first time consuming task. Therefore, the data of the copy of the first time-consuming task is assigned to the original of the first time-consuming task, so that the information system can display the latest state of the first time-consuming task when the state of the first time-consuming task is displayed according to the data of the original of the first time-consuming task.
In order to solve the above problems, an embodiment of the present invention provides a time-consuming task management apparatus of an information-based system, as shown in fig. 2, the apparatus includes a memory 10 and a processor 20,
memory 10 is used to store computer readable instructions;
the processor 20 is configured to execute the computer-readable instructions to perform the following operations:
when an instruction for starting the first time-consuming task is received, starting to run a master of the first time-consuming task, and creating a copy of the first time-consuming task in a time-consuming task container; the information system displays the state of the first time-consuming task in a list according to the original of the first time-consuming task;
and if an instruction for starting the second time-consuming task is received, running the original of the second time-consuming task, stopping running the original of the first time-consuming task, and running the copy of the first time-consuming task in the time-consuming task container.
In an alternative embodiment, before starting the operation of running the original of the first time-consuming task when receiving the instruction to start the first time-consuming task, the processor 20 further performs the following operation:
learning known time-consuming tasks for an informatization system; wherein the known time consuming tasks include a first time consuming task and a second time consuming task.
In an alternative embodiment, running the original of the second time-consuming task, stopping running the original of the first time-consuming task, and running the copy of the first time-consuming task in the time-consuming task container comprises:
running a copy of the first time-consuming task in the time-consuming task container to obtain updated running data of the first time-consuming task until the first time-consuming task is determined to be completed according to the updated running data of the first time-consuming task;
assigning data of the first time-consuming task determined to be completed by the first time-consuming task to a time-consuming task storage area so as to update the original of the first time-consuming task in the time-consuming task storage area;
the copy of the first time consuming task is deleted.
In an alternative embodiment, running the original of the second time-consuming task, stopping running the original of the first time-consuming task, and running the copy of the first time-consuming task in the time-consuming task container comprises:
and if the copy of the first time-consuming task has errors during the operation, assigning the mark for marking the error occurrence of the time-consuming task to the original of the first time-consuming task, and deleting the copy of the first time-consuming task from the time-consuming task container.
In an alternative embodiment, after running the original of the second time-consuming task, stopping running the original of the first time-consuming task, and running the copy of the first time-consuming task in the time-consuming task container, the processor 20 further performs the following operations:
if an instruction for switching to the first time-consuming task is received, assigning a positive copy of the first time-consuming task by using the data of the copy of the first time-consuming task;
and rendering an entry corresponding to the first time-consuming task in the list of the information system according to the original book of the first time-consuming task.
Although the embodiments of the present invention have been described above, the above description is only for the convenience of understanding the present invention, and is not intended to limit the present invention. It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.