CN107783827B - Asynchronous task processing method and device - Google Patents
Asynchronous task processing method and device Download PDFInfo
- Publication number
- CN107783827B CN107783827B CN201610799204.5A CN201610799204A CN107783827B CN 107783827 B CN107783827 B CN 107783827B CN 201610799204 A CN201610799204 A CN 201610799204A CN 107783827 B CN107783827 B CN 107783827B
- Authority
- CN
- China
- Prior art keywords
- asynchronous task
- created
- new
- task
- maintenance system
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/485—Task life-cycle, e.g. stopping, restarting, resuming execution
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses an asynchronous task processing method and device, relates to the technical field of information, and solves the problems that in the prior art, when unexpected conditions such as busy processes, abnormal processes, un-started processes and the like occur, the number of new asynchronous tasks which are not executed is large, and abnormal conditions are caused repeatedly by asynchronous tasks. The main technical scheme of the invention is as follows: when a new asynchronous task needs to be created, detecting whether a process in an operation and maintenance system is normal; if the asynchronous task is normal, creating a new asynchronous task and configuring a created label for the new asynchronous task, wherein the created label is used for identifying that the new asynchronous task is created; and processing the new asynchronous task after the label is created by the configuration. The invention is suitable for processing asynchronous tasks.
Description
Technical Field
The present invention relates to the field of information technologies, and in particular, to an asynchronous task processing method and apparatus.
Background
With the continuous development of information technology, asynchronous task processing modules emerge. The operation and maintenance system of many enterprises generally uses an asynchronous task processing module to start multiple processes to realize asynchronous task processing. When the operation and maintenance system creates an asynchronous task, the running state of the asynchronous task is marked as a stop running state. When the asynchronous task is executed by the process, the running state of the asynchronous task is identified as a running state. If a problem occurs during the running of the asynchronous task and the asynchronous task exits, the running state of the asynchronous task is identified as the running state of stop again, and the completion condition of the asynchronous task is identified as unfinished. If the asynchronous task is executed by the process and the subsequent execution succeeds, the running state of the asynchronous task is identified as the 'stop' running state again, and the completion condition of the asynchronous task is identified as 'completed'. In an operation and maintenance system, when an asynchronous task is judged to fail, the same asynchronous task is usually created again, so that the successful execution of the asynchronous task is ensured.
Currently, when a new asynchronous task needs to be created, the new asynchronous task is created directly. However, when unexpected situations such as busy process, abnormal process, un-started process and the like occur, the created new asynchronous task cannot be executed, the running state identifier of the new asynchronous task is defaulted to be in a "stop" running state, and the completion condition identifier is defaulted to be in "incomplete". If a new asynchronous task needs to be created, the new asynchronous task is directly created, when unexpected situations such as busy process, abnormal process, un-started process and the like occur, the number of the new asynchronous tasks which are not executed is large, in addition, the running state of the new asynchronous task is the same as the running state of the execution failure of the asynchronous task, and the completion condition of the new asynchronous task is the same as the completion condition of the execution failure of the asynchronous task, so that the operation and maintenance system misjudges the situation that the new asynchronous task is not executed as the situation of the execution failure of the asynchronous task, and creates a same asynchronous task again, thereby causing the repetition of the asynchronous task and further causing abnormal situations. For example, the new asynchronous task that is not executed is a restart server task, and when the situation that the restart server task is not executed is judged by mistake as a situation that the execution fails, the operation and maintenance system may re-create the restart task, causing the server to restart twice.
Disclosure of Invention
The present invention has been made in view of the above problems, and aims to provide an asynchronous task processing method and apparatus that overcomes or at least partially solves the above problems.
In order to achieve the purpose, the invention mainly provides the following technical scheme:
in one aspect, the present invention provides an asynchronous task processing method, where the method includes:
when a new asynchronous task needs to be created, detecting whether a process in an operation and maintenance system is normal;
if the asynchronous task is normal, creating a new asynchronous task and configuring a created label for the new asynchronous task, wherein the created label is used for identifying that the new asynchronous task is created;
and processing the new asynchronous task after the label is created by the configuration.
In another aspect, the present invention provides an asynchronous task processing device, including:
the detection unit is used for detecting whether the process in the operation and maintenance system is normal when a new asynchronous task needs to be created;
the creating unit is used for creating a new asynchronous task if the detecting unit detects that the process in the operation and maintenance system is normal;
the configuration unit is used for configuring and creating a label for the new asynchronous task created by the creation unit, and the created label is used for identifying that the new asynchronous task is created;
and the processing unit is used for processing the new asynchronous task configured and created by the configuration unit.
By means of the technical scheme, the invention provides an asynchronous task processing method and device. Firstly, when a new asynchronous task needs to be created, detecting whether a process in an operation and maintenance system is normal; if the asynchronous task is normal, creating a new asynchronous task and configuring a created label for the new asynchronous task, wherein the created label is used for identifying that the new asynchronous task is created; and finally, processing the new asynchronous task after the label is created by the configuration. Compared with the prior art that when a new asynchronous task needs to be created, the new asynchronous task is directly created, the method and the device can reduce the number of new asynchronous tasks which are not executed by detecting whether the process in the operation and maintenance system is normal or not and then creating the new asynchronous task when the process in the operation and maintenance system is normal when the new asynchronous task needs to be created. In addition, the created label is configured for the new asynchronous task, and the created label is used for identifying that the new asynchronous task is created, so that the situation that the new asynchronous task is not executed can be distinguished from the situation that the asynchronous task fails to be executed, misjudgment is avoided, the asynchronous task is prevented from being repeated, and the abnormal situation is avoided.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart of an asynchronous task processing method according to an embodiment of the present invention;
FIG. 2 is a flow chart of another asynchronous task processing method provided by the embodiment of the invention;
FIG. 3 is a schematic structural diagram of an asynchronous task processing device according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of another asynchronous task processing device 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 exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
In order to make the advantages of the technical solutions of the present invention clearer, the present invention is described in detail below with reference to the accompanying drawings and examples.
An embodiment of the present invention provides an asynchronous task processing method, as shown in fig. 1, the method includes:
101. when a new asynchronous task needs to be created, whether the process in the operation and maintenance system is normal is detected.
It should be noted that, when a new asynchronous task creation instruction is received, it is determined that a new asynchronous task needs to be created. And the process in the operation and maintenance system is used for realizing asynchronous task processing. When the process in the operation and maintenance system is normal, the process can process a new asynchronous task; when the process in the operation and maintenance system is abnormal, the new asynchronous task cannot be executed. Specifically, whether the processes in the operation and maintenance system are normal or not can be judged through the idle number of the processes in the operation and maintenance system.
102. And if the process in the operation and maintenance system is normal, creating a new asynchronous task.
For the embodiment of the invention, the new asynchronous task is created when the process in the operation and maintenance system is normal, so that the process can be ensured to execute the new asynchronous task, and the quantity of the new asynchronous task which is not executed can be reduced.
103. A tag is created for the new asynchronous task configuration.
Wherein the create tag is to identify that the new asynchronous task has been created. The created label may be a "created" label. Compared with the current running state identifier of the new asynchronous task defaulted to be the 'stop' running state and the completion condition identifier defaulted to be 'incomplete', the embodiment of the invention can distinguish the condition that the new asynchronous task is not executed from the condition that the asynchronous task is failed to execute by configuring the 'created' label for the new asynchronous task, thereby avoiding misjudgment, avoiding the repetition of the asynchronous task and further avoiding the occurrence of the abnormal condition.
It should be noted that the created tag may be a dynamic created tag, and the running state and the completion condition of the new asynchronous task may be guaranteed to be updated in real time by configuring the dynamic created tag for the new asynchronous task.
104. And processing the new asynchronous task after the label is created by the configuration.
In the embodiment of the present invention, the new asynchronous task after the tag is created in the configuration may be specifically processed by an idle process in the operation and maintenance system.
The embodiment of the invention provides an asynchronous task processing method. Firstly, when a new asynchronous task needs to be created, detecting whether a process in an operation and maintenance system is normal; if the asynchronous task is normal, creating a new asynchronous task and configuring a created label for the new asynchronous task, wherein the created label is used for identifying that the new asynchronous task is created; and finally, processing the new asynchronous task after the label is created by the configuration. Compared with the prior art that when a new asynchronous task needs to be created, the new asynchronous task is directly created, the method and the device can reduce the number of new asynchronous tasks which are not executed by detecting whether the process in the operation and maintenance system is normal or not and then creating the new asynchronous task when the process in the operation and maintenance system is normal when the new asynchronous task needs to be created. In addition, the created label is configured for the new asynchronous task, and the created label is used for identifying that the new asynchronous task is created, so that the situation that the new asynchronous task is not executed can be distinguished from the situation that the asynchronous task fails to be executed, misjudgment is avoided, the asynchronous task is prevented from being repeated, and the abnormal situation is avoided.
An embodiment of the present invention provides another asynchronous task processing method, as shown in fig. 2, the method includes:
201. when a new asynchronous task needs to be created, whether the process in the operation and maintenance system is normal is detected. If the process in the operation and maintenance system is normal, executing step 202; if the process in the operation and maintenance system is abnormal, step 206 is executed.
For the embodiment of the present invention, the detecting whether the process in the operation and maintenance system is normal may include: whether the idle number of the processes in the operation and maintenance system is larger than or equal to a preset threshold value is detected. The preset threshold may be set according to a user requirement, or may be set according to a default mode of the system, which is not limited in the embodiment of the present invention. For example, the preset threshold may be 1, 2, etc. When the idle number of the processes in the operation and maintenance system is detected to be greater than or equal to the preset threshold value, the operation and maintenance system is indicated to be capable of executing the new asynchronous task. When the idle number of the processes in the operation and maintenance system is detected to be smaller than the preset threshold, it is indicated that the operation and maintenance system has no capability of executing the new asynchronous task, and at this time, the new asynchronous task is created, which causes that the new asynchronous task cannot be executed, and therefore, the wait is needed.
202. A new asynchronous task is created.
In the embodiment of the invention, if the process in the operation and maintenance system is normal, the creating unit can be called to create the new asynchronous task, the new asynchronous task is recorded in the database, and the identification information of the new asynchronous task is sent to the configuration unit, so that the configuration unit configures the creating label for the new asynchronous task according to the identification information.
203. A tag is created for the new asynchronous task configuration.
Wherein the create tag is to identify that the new asynchronous task has been created. It should be noted that the tag can be created for the new asynchronous task configuration by calling the configuration unit. The configuration unit may receive the identification information of the new asynchronous task sent by the creation unit, then search for the corresponding new asynchronous task in the database according to the identification information, and finally configure the creation label for the searched new asynchronous task.
204. And processing the new asynchronous task after the label is created by the configuration.
205. A timestamp is created for the new asynchronous task configuration.
Wherein the creation timestamp is used to indicate the time at which the new asynchronous task was created. Subsequent analysis of asynchronous tasks may be facilitated by creating timestamps for the new asynchronous task configurations. For example, when log data in the operation and maintenance system is analyzed subsequently, the creation condition and the execution condition of the asynchronous task are known through creating the timestamp.
206. And waiting and re-executing to detect whether the process in the operation and maintenance system is normal within a preset waiting time period.
The preset time period may be set according to the requirement of the user, or may be set according to a default mode of the system, which is not limited in the embodiment of the present invention. For example, the preset time period may be 10s, 20s, etc. It should be noted that, after detecting whether a process in the operation and maintenance system is normal, when detecting that a process in the operation and maintenance system is normal, the steps of creating a new asynchronous task and configuring a creation tag and a creation timestamp for the new asynchronous task may be continuously performed, and when detecting that a process in the operation and maintenance system is abnormal, the steps of waiting and, within a preset waiting time period, detecting whether a process in the operation and maintenance system is normal are continuously performed until a process in the operation and maintenance system is normal.
For example, when a new asynchronous task needs to be created, whether a process in the operation and maintenance system is normal or not is detected. When the process in the operation and maintenance system is abnormal, the operation and maintenance system can enter a waiting state, and then the operation and maintenance system waits for 10s, and whether the process in the operation and maintenance system is normal is continuously detected until the process in the operation and maintenance system is normal. And when the process in the operation and maintenance system is detected to be normal, a new asynchronous task is created, and a new asynchronous task configuration creation label is configured.
For the embodiment of the invention, a certain time is needed for the operation and maintenance system to recover to normal, and whether the process in the operation and maintenance system is normal is detected by waiting and in a preset waiting time period, so that system resources consumed for always detecting whether the process in the operation and maintenance system is normal can be saved.
For the embodiment of the present invention, the method further includes: when the operation and maintenance system is started for the first time, detecting whether an asynchronous task with a running state being a running state exists in a preset task library, wherein different asynchronous tasks are stored in the preset task library; and if so, identifying the running state of the asynchronous task as a running stop state.
It should be noted that, when the operation and maintenance system crashes for unknown reasons, the asynchronous task in which the process is running is also closed. In this case, the running state of the asynchronous task is still the running state. By marking the running state of the asynchronous task as the stop running state when the operation and maintenance system is started for the first time, it can be ensured that all asynchronous tasks suddenly crashed in the middle of the running state can be started again by the operation and maintenance system.
The embodiment of the invention provides another asynchronous task processing method. Firstly, when a new asynchronous task needs to be created, detecting whether a process in an operation and maintenance system is normal; if the asynchronous task is normal, creating a new asynchronous task and configuring a created label for the new asynchronous task, wherein the created label is used for identifying that the new asynchronous task is created; and finally, processing the new asynchronous task after the label is created by the configuration. Compared with the prior art that when a new asynchronous task needs to be created, the new asynchronous task is directly created, the method and the device can reduce the number of new asynchronous tasks which are not executed by detecting whether the process in the operation and maintenance system is normal or not and then creating the new asynchronous task when the process in the operation and maintenance system is normal when the new asynchronous task needs to be created. In addition, the created label is configured for the new asynchronous task, and the created label is used for identifying that the new asynchronous task is created, so that the situation that the new asynchronous task is not executed can be distinguished from the situation that the asynchronous task fails to be executed, misjudgment is avoided, the asynchronous task is prevented from being repeated, and the abnormal situation is avoided.
Further, an embodiment of the present invention provides an asynchronous task processing apparatus, as shown in fig. 3, where the apparatus includes: a detection unit 31, a creation unit 32, a configuration unit 33, a processing unit 34.
The detecting unit 31 may be configured to detect whether a process in the operation and maintenance system is normal when a new asynchronous task needs to be created. Specifically, whether the processes in the operation and maintenance system are normal or not can be judged through the idle number of the processes in the operation and maintenance system.
The creating unit 32 may be configured to create a new asynchronous task if the detecting unit 31 detects that the process in the operation and maintenance system is normal. By creating the new asynchronous task when the process in the operation and maintenance system is normal, the process can be ensured to execute the new asynchronous task, and the quantity of the new asynchronous task which is not executed can be reduced.
A configuration unit 33, configured to create a tag for the new asynchronous task configuration created by the creation unit 32, where the created tag is used to identify that the new asynchronous task has been created. The creating a label may be a dynamically created label.
The processing unit 34 may be configured to process the new asynchronous task configured by the configuration unit 33 after the tag is created.
It should be noted that, for other corresponding descriptions of the functional units related to the asynchronous task processing device provided in the embodiment of the present invention, reference may be made to corresponding descriptions of the method shown in fig. 1, which are not described herein again, but it should be clear that the device in the embodiment can correspondingly implement all the contents in the foregoing method embodiments.
The embodiment of the invention provides an asynchronous task processing device. The device comprises: the device comprises a detection unit, a creation unit, a configuration unit and a processing unit. The detection unit can be used for detecting whether the process in the operation and maintenance system is normal when a new asynchronous task needs to be created; the creating unit may be configured to create a new asynchronous task if the detecting unit detects that the process in the operation and maintenance system is normal; a configuration unit, configured to configure a creation tag for the new asynchronous task created by the creation unit, where the creation tag is used to identify that the new asynchronous task has been created; and the processing unit is used for processing the new asynchronous task configured and created by the configuration unit. Compared with the prior art that when a new asynchronous task needs to be created, the new asynchronous task is directly created, the method and the device can reduce the number of new asynchronous tasks which are not executed by detecting whether the process in the operation and maintenance system is normal or not and then creating the new asynchronous task when the process in the operation and maintenance system is normal when the new asynchronous task needs to be created. In addition, the created label is configured for the new asynchronous task, and the created label is used for identifying that the new asynchronous task is created, so that the situation that the new asynchronous task is not executed can be distinguished from the situation that the asynchronous task fails to be executed, misjudgment is avoided, the asynchronous task is prevented from being repeated, and the abnormal situation is avoided.
Further, an embodiment of the present invention provides another asynchronous task processing device, as shown in fig. 4, where the device includes: a detection unit 41, a creation unit 42, a configuration unit 43 and a processing unit 44.
The detecting unit 41 may be configured to detect whether a process in the operation and maintenance system is normal when a new asynchronous task needs to be created.
The creating unit 42 may be configured to create a new asynchronous task if the detecting unit 41 detects that the process in the operation and maintenance system is normal.
A configuration unit 43, configured to configure a creation tag for the new asynchronous task created by the creation unit 42, where the creation tag is used to identify that the new asynchronous task has been created.
The processing unit 44 may be configured to process the new asynchronous task configured by the configuration unit after the tag is created.
The detecting unit 41 may be specifically configured to detect whether an idle number of processes in the operation and maintenance system is greater than or equal to a preset threshold.
The creating unit 42 may be specifically configured to create a new asynchronous task if the detecting unit 41 detects that the idle number is greater than or equal to a preset threshold.
The waiting unit 45 may be configured to wait if the detecting unit 41 detects that the idle number is smaller than a preset threshold.
The detecting unit 41 may be further configured to perform, again within a preset waiting time period, detection whether a process in the operation and maintenance system is normal. The preset time period may be set according to the requirement of the user, or may be set according to a default mode of the system, which is not limited in the embodiment of the present invention. For example, the preset time period may be 10s, 20s, etc.
The configuration unit 43 may be further configured to create a timestamp for the new asynchronous task configuration created by the creation unit 42.
Further, the apparatus further comprises: the unit 46 is identified.
The detecting unit 41 may be further configured to detect whether an asynchronous task whose running state is the running state exists in a preset task library when the operation and maintenance system is started for the first time, where different asynchronous tasks are stored in the preset task library.
The identification unit 46 may be configured to detect that an asynchronous task whose running state is the running state exists in a preset task library by the detection unit 41. By marking the running state of the asynchronous task as the stop running state when the operation and maintenance system is started for the first time, it can be ensured that all asynchronous tasks suddenly crashed in the middle of the running state can be started again by the operation and maintenance system.
It should be noted that, for other corresponding descriptions of the functional units related to another asynchronous task processing device provided in the embodiment of the present invention, reference may be made to corresponding descriptions of the method shown in fig. 2, which are not described herein again, but it should be clear that the device in this embodiment can correspondingly implement all the contents in the foregoing method embodiments.
The embodiment of the invention provides another asynchronous task processing device. The device comprises: the device comprises a detection unit, a creation unit and a configuration unit. The detection unit is used for detecting whether the process in the operation and maintenance system is normal when a new asynchronous task needs to be created; the creating unit is used for creating a new asynchronous task if the detecting unit detects that the process in the operation and maintenance system is normal; the configuration unit is used for configuring and creating a label for the new asynchronous task created by the creation unit, and the created label is used for identifying that the new asynchronous task is created; and the processing unit is used for processing the new asynchronous task configured and created by the configuration unit. Compared with the prior art that when a new asynchronous task needs to be created, the new asynchronous task is directly created, the method and the device can reduce the number of new asynchronous tasks which are not executed by detecting whether the process in the operation and maintenance system is normal or not and then creating the new asynchronous task when the process in the operation and maintenance system is normal when the new asynchronous task needs to be created. In addition, the created label is configured for the new asynchronous task, and the created label is used for identifying that the new asynchronous task is created, so that the situation that the new asynchronous task is not executed can be distinguished from the situation that the asynchronous task fails to be executed, misjudgment is avoided, the asynchronous task is prevented from being repeated, and the abnormal situation is avoided.
The asynchronous task processing device comprises a processor and a memory, wherein the detection unit, the creation unit, the configuration unit, the processing unit, the waiting unit, the identification unit and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. One or more than one kernel can be set, and the efficiency and the accuracy of the emotional feature recognition are improved by adjusting the kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
The present application further provides a computer program product adapted to perform program code for initializing the following method steps when executed on a data processing device: when a new asynchronous task needs to be created, detecting whether a process in an operation and maintenance system is normal; if the asynchronous task is normal, creating a new asynchronous task and configuring a created label for the new asynchronous task, wherein the created label is used for identifying that the new asynchronous task is created; and processing the new asynchronous task after the label is created by the configuration.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims (10)
1. An asynchronous task processing method, comprising:
when the asynchronous task execution fails, detecting whether the process in the operation and maintenance system is normal, including: detecting whether the idle number of processes in the operation and maintenance system is greater than or equal to a preset threshold value or not;
if the idle number is larger than or equal to a preset threshold value, creating a new asynchronous task and configuring a created label for the new asynchronous task, wherein the created label is used for identifying that the new asynchronous task is created;
and processing a new asynchronous task after the label is created, wherein the new asynchronous task is the same as an asynchronous task which fails before, and the created label can distinguish the situation that the new asynchronous task is not executed from the situation that the asynchronous task fails to execute.
2. The method of claim 1, wherein after detecting whether the process in the operation and maintenance system is normal, the method further comprises:
if not, waiting is carried out, and whether the process in the operation and maintenance system is normal or not is detected again within a preset waiting time period.
3. The method of claim 1, wherein after creating the tag for the new asynchronous task configuration, the method further comprises:
creating a timestamp for the new asynchronous task configuration.
4. The method of claim 1, further comprising:
when the operation and maintenance system is started for the first time, detecting whether an asynchronous task with a running state being a running state exists in a preset task library, wherein different asynchronous tasks are stored in the preset task library;
and if so, identifying the running state of the asynchronous task as a running stop state.
5. An asynchronous task processing apparatus, comprising:
the detection unit is used for detecting whether the processes in the operation and maintenance system are normal or not when the asynchronous task execution fails, and specifically, detecting whether the idle number of the processes in the operation and maintenance system is greater than or equal to a preset threshold value or not;
a creating unit, configured to create a new asynchronous task if the detecting unit detects that the process in the operation and maintenance system is normal, including: specifically, if the detection unit detects that the idle number is greater than or equal to a preset threshold, a new asynchronous task is created;
the configuration unit is used for configuring and creating a label for the new asynchronous task created by the creation unit, and the created label is used for identifying that the new asynchronous task is created;
and the processing unit is used for processing the new asynchronous task after the configuration unit configures and creates the label, the new asynchronous task is the same as the asynchronous task which fails before, and the created label can distinguish the situation that the new asynchronous task is not executed from the situation that the asynchronous task fails to be executed.
6. The apparatus of claim 5, further comprising: the waiting unit is used for waiting for the unit,
the waiting unit is used for waiting if the detection unit detects that the idle number is smaller than a preset threshold value;
the detection unit is further configured to perform detection again to determine whether the process in the operation and maintenance system is normal within a preset waiting time period.
7. The apparatus of claim 5,
the configuration unit is further configured to create a timestamp for the new asynchronous task configuration created by the creation unit.
8. The apparatus of claim 5, further comprising: the identification unit is used for identifying the unit,
the detection unit is further configured to detect whether an asynchronous task in which an operating state is a running state exists in a preset task library when the operation and maintenance system is started for the first time, where different asynchronous tasks are stored in the preset task library;
the identification unit is used for identifying the running state of the asynchronous task as a running stop state if the detection unit detects that the asynchronous task with the running state being the running state exists in the preset task library.
9. A storage medium, comprising a stored program, wherein when the program runs, a device on which the storage medium is located is controlled to execute the asynchronous task processing method according to any one of claims 1 to 4.
10. A processor, configured to run a program, wherein the program when running performs the asynchronous task processing method of any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610799204.5A CN107783827B (en) | 2016-08-31 | 2016-08-31 | Asynchronous task processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610799204.5A CN107783827B (en) | 2016-08-31 | 2016-08-31 | Asynchronous task processing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107783827A CN107783827A (en) | 2018-03-09 |
CN107783827B true CN107783827B (en) | 2021-06-08 |
Family
ID=61451902
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610799204.5A Active CN107783827B (en) | 2016-08-31 | 2016-08-31 | Asynchronous task processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107783827B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101038488A (en) * | 2007-05-09 | 2007-09-19 | 重庆交通大学 | Bridge remote monitoring system |
CN101827140A (en) * | 2009-03-03 | 2010-09-08 | 展讯通信(上海)有限公司 | Method for writing data in user identification module card and mobile terminal |
CN103220481A (en) * | 2011-11-04 | 2013-07-24 | 株式会社理光 | Image display apparatus and image display method |
CN105095299A (en) * | 2014-05-16 | 2015-11-25 | 北京奇虎科技有限公司 | Picture capturing method and system |
WO2016036983A1 (en) * | 2014-09-04 | 2016-03-10 | Home Box Office, Inc. | Asynchronous task multiplexing and chaining |
CN105847173A (en) * | 2016-04-25 | 2016-08-10 | 乐视控股(北京)有限公司 | Content providing control method, terminal device and user device |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101334742B (en) * | 2008-08-05 | 2011-06-01 | 中国科学院软件研究所 | Java EE applications server parallel processing method |
CN101488204A (en) * | 2009-02-25 | 2009-07-22 | 中国网络通信集团公司 | Task optimization scheduling system |
CN103186386B (en) * | 2011-12-27 | 2017-10-27 | 腾讯科技(深圳)有限公司 | Using loading method and system |
US10223360B2 (en) * | 2014-12-02 | 2019-03-05 | Ricoh Company, Ltd. | Print job archives that are optimized for server hardware |
CN105159768A (en) * | 2015-09-09 | 2015-12-16 | 浪潮集团有限公司 | Task management method and cloud data center management platform |
-
2016
- 2016-08-31 CN CN201610799204.5A patent/CN107783827B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101038488A (en) * | 2007-05-09 | 2007-09-19 | 重庆交通大学 | Bridge remote monitoring system |
CN101827140A (en) * | 2009-03-03 | 2010-09-08 | 展讯通信(上海)有限公司 | Method for writing data in user identification module card and mobile terminal |
CN103220481A (en) * | 2011-11-04 | 2013-07-24 | 株式会社理光 | Image display apparatus and image display method |
CN105095299A (en) * | 2014-05-16 | 2015-11-25 | 北京奇虎科技有限公司 | Picture capturing method and system |
WO2016036983A1 (en) * | 2014-09-04 | 2016-03-10 | Home Box Office, Inc. | Asynchronous task multiplexing and chaining |
CN105847173A (en) * | 2016-04-25 | 2016-08-10 | 乐视控股(北京)有限公司 | Content providing control method, terminal device and user device |
Also Published As
Publication number | Publication date |
---|---|
CN107783827A (en) | 2018-03-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109558548B (en) | Method for eliminating CSS style redundancy and related product | |
CN110647463B (en) | Method and device for restoring test breakpoint and electronic equipment | |
CN109002348B (en) | Load balancing method and device in virtualization system | |
CN107783827B (en) | Asynchronous task processing method and device | |
EP4235418A1 (en) | Collaborative learning-based cloud migration implementation | |
US20230244565A1 (en) | Systems and Methods for Pause-Correct-Replay Workflow Customization | |
CN116643906A (en) | Cloud platform fault processing method and device, electronic equipment and storage medium | |
CN109992466B (en) | Virtual machine fault detection method and device, computer readable storage medium and electronic equipment | |
CN115454599A (en) | Task processing method, system, device, storage medium and electronic equipment | |
CN114416442A (en) | Hardware change detection method and device, electronic equipment and readable storage medium | |
CN110955813A (en) | Data crawling method and device | |
CN113900856A (en) | Data processing method and related equipment | |
CN110908876B (en) | Method and device for acquiring hardware performance data | |
CN108647113B (en) | Disaster recovery method and server | |
CN110442467B (en) | Data sharing method, terminal and computer readable storage medium | |
CN104239199A (en) | Virtual robot generation method, automatic test method and related device | |
US10102052B2 (en) | Dumping resources | |
CN107797915B (en) | Fault repairing method, device and system | |
JP2021005379A (en) | Method for detecting deep learning chip, device, electronic apparatus, and computer storage medium | |
CN110647419A (en) | Fault detection method and device, computer storage medium and terminal | |
CN110717131A (en) | Page revising monitoring method and related system | |
CN113835912B (en) | Crash information processing method and device for application program | |
US20220141241A1 (en) | Information processing apparatus, computer program product, and information processing system | |
CN113961968B (en) | Method and device for carrying out data desensitization interrupt post-processing on file | |
CN113076264B (en) | Memory management method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: 100083 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing Applicant after: Beijing Guoshuang Technology Co.,Ltd. Address before: 100086 Cuigong Hotel, 76 Zhichun Road, Shuangyushu District, Haidian District, Beijing Applicant before: Beijing Guoshuang Technology Co.,Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |