CN110990132A - Asynchronous task processing method and device, computer equipment and storage medium - Google Patents

Asynchronous task processing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN110990132A
CN110990132A CN201911058346.6A CN201911058346A CN110990132A CN 110990132 A CN110990132 A CN 110990132A CN 201911058346 A CN201911058346 A CN 201911058346A CN 110990132 A CN110990132 A CN 110990132A
Authority
CN
China
Prior art keywords
task
asynchronous
queue
asynchronous task
unexecuted
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.)
Granted
Application number
CN201911058346.6A
Other languages
Chinese (zh)
Other versions
CN110990132B (en
Inventor
陈曦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dasou Vehicle Software Technology Co Ltd
Original Assignee
Zhejiang Dasou Vehicle Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dasou Vehicle Software Technology Co Ltd filed Critical Zhejiang Dasou Vehicle Software Technology Co Ltd
Priority to CN201911058346.6A priority Critical patent/CN110990132B/en
Publication of CN110990132A publication Critical patent/CN110990132A/en
Application granted granted Critical
Publication of CN110990132B publication Critical patent/CN110990132B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5055Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering software capabilities, i.e. software resources associated or available to the machine
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application relates to an asynchronous task processing method, an asynchronous task processing device, computer equipment and a storage medium. Relates to the technical field of computers. The method comprises the following steps: firstly, detecting whether an unexecuted asynchronous task exists in a task database; then when detecting that the unexecuted asynchronous task exists in the task database, adding the unexecuted asynchronous task into a corresponding task queue according to the type of the unexecuted asynchronous task; and finally, when an idle thread exists, executing the asynchronous task in the task queue by using the idle thread. The method can simplify the operation of processing the asynchronous task.

Description

Asynchronous task processing method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to an asynchronous task processing method and apparatus, a computer device, and a storage medium.
Background
With the development of computer technology, software development becomes common, in the process of software development, an asynchronous task is a very common requirement, some time-consuming operations need to be put into an asynchronous queue to be executed, and a delayed task is also one of asynchronous tasks, such as a timing policy requirement in a trading scene. The processing of asynchronous tasks can currently be implemented by means of message queue middleware.
In the related method for realizing asynchronous task processing through message queue middleware, a Topic mode (English: Topic), a producer number (English: CID) and a consumer number (English: PID) need to be applied in advance. Then the producer (namely the producer of the asynchronous task) puts the asynchronous task into the message queue middleware in the form of a message, and the consumer (namely the processor of the asynchronous task) asynchronously obtains the message from the consumption queue for task processing.
However, the current method for processing asynchronous tasks by using message queue middleware has the problem of complicated operation.
Disclosure of Invention
In view of the foregoing, it is desirable to provide an asynchronous task processing method, an asynchronous task processing apparatus, a computer device, and a storage medium, which are easy to operate.
In a first aspect, a method for processing an asynchronous task is provided, where the method includes:
detecting whether an unexecuted asynchronous task exists in a task database;
when the unexecuted asynchronous task exists in the task database, adding the unexecuted asynchronous task into a corresponding task queue according to the type of the unexecuted asynchronous task;
and when the idle thread exists, executing the asynchronous task in the task queue by using the idle thread.
In one embodiment, the detecting whether there are non-executed asynchronous tasks in the task database includes:
acquiring polling interval duration according to preset interval duration and the number of clients in a system corresponding to the task database;
and polling and detecting whether the unexecuted asynchronous task exists in the task database or not according to the polling interval duration.
In one embodiment, the adding the asynchronous task to the corresponding task queue according to the type of the asynchronous task includes:
when the type of the unexecuted asynchronous task is a dependent type or a delay type, adding the unexecuted asynchronous task to a waiting queue, wherein the dependent type is used for representing that the execution condition of the asynchronous task can be executed only after the completion of a front task, and the delay type is used for representing that the execution condition of the asynchronous task can be executed only after waiting for a certain time;
when the type of the unexecuted asynchronous task is not a dependent type or a delay type, adding the unexecuted asynchronous task to a ready queue;
and when the asynchronous task in the waiting queue meets the execution condition, adding the asynchronous task meeting the execution condition into the ready queue.
In one embodiment, when there is an idle thread, executing the asynchronous task in the task queue by using the idle thread, includes:
when the idle thread exists, acquiring asynchronous tasks from the ready queue according to the sequence added to the ready queue;
adding the obtained asynchronous task into an execution queue;
and executing the asynchronous tasks in the execution queue by using the idle thread according to the sequence added to the execution queue.
In one embodiment, after the executing the asynchronous task in the execution queue by the idle thread, the method further includes:
when the asynchronous task is executed successfully, the successfully executed asynchronous task is added to a success queue;
when the asynchronous task fails to be executed, the asynchronous task which fails to be executed is added to a retry queue, and the asynchronous task in the retry queue enters the ready queue to wait for being executed again;
and when the number of times of the asynchronous tasks which are executed again exceeds a first preset threshold value, adding the asynchronous tasks which are executed again and exceed the first preset threshold value to the death queue.
In one embodiment, the method further comprises:
sending the number of the asynchronous tasks in the waiting queue, the ready queue, the execution queue, the success queue, the retry queue and the death queue to an asynchronous task management terminal so that the asynchronous task management terminal can display the number of the asynchronous tasks;
when the number of the asynchronous tasks in any one of the waiting queue, the ready queue, the execution queue, the success queue, the retry queue and the death queue exceeds a second preset threshold value, sending alarm information to the asynchronous task management terminal, so that the asynchronous task management terminal can display the alarm information.
In one embodiment, before the detecting whether there is an unexecuted asynchronous task in the task database, the method further comprises:
acquiring the type of the unexecuted asynchronous task;
and storing the corresponding relation between the unexecuted asynchronous task and the type of the unexecuted asynchronous task into the task database.
In a second aspect, an asynchronous task processing device is provided, the device comprising:
the detection module is used for detecting whether the unexecuted asynchronous task exists in the task database;
the first adding module is used for adding the unexecuted asynchronous task into a corresponding task queue according to the type of the unexecuted asynchronous task when detecting that the unexecuted asynchronous task exists in the task database;
and the execution module is used for executing the asynchronous task in the task queue by using the idle thread when the idle thread exists.
In one embodiment, the detection module is specifically configured to obtain a polling interval duration according to a preset interval duration and the number of clients in the system corresponding to the task database;
and polling and detecting whether the unexecuted asynchronous task exists in the task database or not according to the polling interval duration.
In one embodiment, the first adding module is specifically configured to, when the type of the unexecuted asynchronous task is a dependent type or a delay type, add the unexecuted asynchronous task to the wait queue, where the dependent type is used to characterize that the execution condition of the asynchronous task must be executed after the preceding task is completed, and the delay type is used to characterize that the execution condition of the asynchronous task needs to wait for a certain time period before being executed;
when the type of the unexecuted asynchronous task is not a dependent type or a delay type, adding the unexecuted asynchronous task to a ready queue;
and when the asynchronous task in the waiting queue meets the execution condition, adding the asynchronous task meeting the execution condition into the ready queue.
In one embodiment, the execution module is specifically configured to, when the idle thread exists, obtain the asynchronous task from the ready queue according to an order of adding to the ready queue;
adding the obtained asynchronous task into an execution queue;
and executing the asynchronous tasks in the execution queue by using the idle thread according to the sequence added to the execution queue.
In one embodiment, the device further comprises a second adding module, wherein the second adding module is used for adding the successfully executed asynchronous task to the success queue when the asynchronous task is successfully executed;
when the asynchronous task fails to be executed, the asynchronous task which fails to be executed is added to a retry queue, and the asynchronous task in the retry queue enters the ready queue to wait for being executed again;
and when the number of times of the asynchronous tasks which are executed again exceeds a first preset threshold value, adding the asynchronous tasks which are executed again and exceed the first preset threshold value to the death queue.
In one embodiment, the apparatus further includes a sending module, configured to send the number of asynchronous tasks in the wait queue, the ready queue, the execution queue, the success queue, the retry queue, and the death queue to an asynchronous task management terminal, so that the asynchronous task management terminal displays the number of asynchronous tasks;
when the number of the asynchronous tasks in any one of the waiting queue, the ready queue, the execution queue, the success queue, the retry queue and the death queue exceeds a second preset threshold value, sending alarm information to the asynchronous task management terminal, so that the asynchronous task management terminal can display the alarm information.
In one embodiment, the apparatus further includes an obtaining module, configured to obtain a type of the unexecuted asynchronous task;
and storing the corresponding relation between the unexecuted asynchronous task and the type of the unexecuted asynchronous task into the task database.
In a third aspect, there is provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any of the first aspects when executing the computer program.
In a fourth aspect, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the method of any of the first aspects described above.
The asynchronous task processing method, the asynchronous task processing device, the computer equipment and the storage medium detect whether the unexecuted asynchronous task exists in the task database; then when detecting that the unexecuted asynchronous task exists in the task database, adding the unexecuted asynchronous task into a corresponding task queue according to the type of the unexecuted asynchronous task; and finally, when an idle thread exists, executing the asynchronous task in the task queue by using the idle thread. According to the asynchronous task processing method, when the executed asynchronous task exists, the asynchronous task can be processed directly by using the idle thread, Topic, CID and PID do not need to be applied in advance, and the operation of processing the asynchronous task is simplified to a certain extent.
Drawings
FIG. 1 is a diagram illustrating an exemplary implementation of a method for asynchronous task processing;
FIG. 2 is a flow diagram that illustrates a method for asynchronous task processing, according to one embodiment;
FIG. 3 is a flow diagram that illustrates a method for detecting whether an unexecuted asynchronous task exists in a task database, under an embodiment;
FIG. 4 is a diagram of relationships between various task queues, under an embodiment;
FIG. 5 is a flow diagram that illustrates a method for performing asynchronous tasks, according to one embodiment;
FIG. 6 is a flow diagram that illustrates a method for processing an executed asynchronous task, under an embodiment;
FIG. 7 is an interface diagram of an asynchronous task management terminal in one embodiment;
FIG. 8 is a flow diagram that illustrates a method for obtaining unexecuted asynchronous tasks, under an embodiment;
FIG. 9 is a block diagram showing the structure of an asynchronous task processing device according to an embodiment;
FIG. 10 is a block diagram of another asynchronous task processing device in one embodiment;
FIG. 11 is a diagram illustrating an internal structure of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
With the development of computer technology, software development becomes common, and in the process of software development, two tasks, namely a synchronous task and an asynchronous task, exist. Synchronous tasks indicate that tasks in a main thread are executed from top to bottom in sequence, that is, each task needs to wait for the execution of the previous task to complete before being executed. If a task that takes a long time to execute appears in the main thread at this time, it means that other tasks in the main thread cannot be executed and a long wait is required while executing the task that takes a long time. This is certainly a time-consuming task execution mode, and thus, compared to a synchronous task, an asynchronous task execution mode occurs, in which a task in a main thread may not execute a program in sequence, for example, one of the main threads may execute a task that is long in time, and when the task is executed, the task may be suspended or put into another thread to be executed, and a subsequent task may be continuously executed without waiting for the task to be executed completely.
Asynchronous tasks are more efficient to execute than synchronous tasks, so that the asynchronous tasks become an increasingly common requirement in the field of software development, for example, some time-consuming operations need to be put into an asynchronous queue to be executed, and a delayed task is also one of the asynchronous tasks. Meanwhile, various methods for processing asynchronous tasks have appeared, and at present, the processing of asynchronous tasks can be realized by a message queue middleware method.
In the method for realizing asynchronous task processing by the related message queue middleware, a producer can send asynchronous tasks to be processed to the message queue middleware in a message form, all the asynchronous tasks can exist in the message queue middleware, and then a consumer can acquire the asynchronous tasks from the message queue middleware and execute the acquired asynchronous tasks. However, when the message queue middleware is used to implement the processing of the asynchronous task, developers need to apply for corresponding Topic, CID and PID in advance, so that the problem of complex operation occurs in the process of processing the asynchronous task by using the message queue middleware.
The asynchronous task processing method provided by the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 103 via a network. The server 103 may maintain a task database, the terminal 102 may detect whether an unexecuted asynchronous task exists in the task database, when the terminal 102 detects that the unexecuted asynchronous task exists in the task database, the asynchronous task may be added to a corresponding task queue according to a type of the unexecuted asynchronous task, and when an idle thread exists on the terminal 102, the terminal 102 may execute the asynchronous task in the task queue using the idle thread. The terminal 101 communicates with the terminal 102 through a network, and the terminal 101 may be used as an asynchronous task management terminal, receives the alarm information sent by the terminal 102 and the number of tasks included in each task queue when processing an asynchronous task, and displays the received alarm information and the number of tasks included in each task queue.
The terminals 101 and 102 may be, but are not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 103 may be implemented by an independent server or a server cluster formed by a plurality of servers.
In the embodiment of the present application, as shown in fig. 2, an asynchronous task processing method is provided, which is described by taking the method as an example applied to the terminal 102 in fig. 1, and includes the following steps:
in step 201, the computer device detects whether there is an unexecuted asynchronous task in the task database.
In this step, the task database may store unexecuted asynchronous tasks, and the computer device may detect that the unexecuted asynchronous tasks are stored in the task database by using a poller, where the poller includes a plurality of independent background threads started by a software tool development kit (english: SDK).
These asynchronous tasks each have a corresponding identification that may include the type and class name of the task processing class to which the asynchronous task that was not executed corresponds. The type is used for indicating that the unexecuted asynchronous task is added to a corresponding task queue in the subsequent operation. The class name of the processing class is used for indicating that the asynchronous task is correspondingly processed according to the class name of the task processing class in the subsequent operation. For example, when a software developer develops banking services, it is stated that the asynchronous task processing class includes a deposit class and a borrowing class, and when the class name of the task processing class of the asynchronous task is the deposit class, the computer device executes the asynchronous task according to the logical manner of the deposit class established in advance.
Step 202, when the computer device detects that the unexecuted asynchronous task exists in the task database, adding the unexecuted asynchronous task to a corresponding task queue according to the type of the unexecuted asynchronous task.
In this step, when the computer device detects an unexecuted asynchronous task by using the poller, the computer device also detects the type of the unexecuted asynchronous task and the class name of the task processing class. And then, adding the unexecuted asynchronous task into a corresponding task queue according to the type of the unexecuted asynchronous task, wherein the corresponding relation between the type and the task queue can be preset according to the requirement. The state of asynchronous tasks contained in different task queues is different.
In step 203, when there is an idle thread, the computer device executes the asynchronous task in the task queue by using the idle thread.
A thread is the smallest unit that an operating system can perform operation scheduling, and can be understood as a resource that can execute a task.
The presence of an idle thread indicates that there is a resource capable of executing an asynchronous task, and thus, when an idle thread is present, the asynchronous task can be executed using the idle thread. And because of the atomicity guarantee of the task database, an asynchronous task can be acquired by only one computer device and can also be executed on only one computer device.
In the asynchronous task processing method, whether an unexecuted asynchronous task exists in a task database is detected; then when detecting that the unexecuted asynchronous task exists in the task database, adding the unexecuted asynchronous task into a corresponding task queue according to the type of the unexecuted asynchronous task; and finally, when an idle thread exists, executing the asynchronous task in the task queue by using the idle thread. According to the asynchronous task processing method, when the executed asynchronous task exists, the asynchronous task can be processed directly by using the idle thread, Topic, CID and PID do not need to be applied in advance, and the operation of processing the asynchronous task is simplified to a certain extent.
In an embodiment of the present application, a method for detecting whether there is an unexecuted asynchronous task in a task database is provided, please refer to fig. 3, which includes the following steps:
step 301, the computer device obtains the polling interval duration according to the preset interval duration and the number of the clients in the system corresponding to the task database.
In this step, if a large number of clients in the system access and detect the task database at the same time, the system is likely to fail, and therefore the polling interval duration needs to be dynamically set according to the number of the clients, so that system failure is avoided.
Step 302, the computer device performs polling detection on whether the unexecuted asynchronous task exists in the task database according to the polling interval duration.
Optionally, the polling interval duration is calculated by using a calculation method of avg interval (1/2+ random) size, where avg interval represents a preset interval duration, and a value of the preset interval duration may be adjusted according to needs, for example, the preset interval duration is preset to be 15 seconds. Number of clients in size system. random is a random variable with a value range of [0,1 ].
In the embodiment of the application, the detection task database is prevented from being operated too frequently due to the increase of the number of the clients. By setting the polling interval duration and adding the number of the clients and the random number in the calculation mode of the polling interval duration, the polling interval duration is guaranteed to be dynamically adjusted along with the number of the clients, the polling interval duration changes due to different random numbers at each time, peak-off detection is achieved, and the availability of a system is guaranteed to a certain extent.
In the embodiment of the present application, please refer to fig. 4, which provides a relationship diagram between task queues in the present application. As shown in fig. 4, when the type of the unexecuted asynchronous task is a dependent type or a delayed type, the computer device adds the unexecuted asynchronous task to a waiting queue (as indicated by a in fig. 4), wherein the dependent type is used for representing that the execution condition of the asynchronous task needs to be executed after the completion of the preceding task, and the delayed type is used for representing that the execution condition of the asynchronous task needs to be executed after waiting for a certain time;
when the type of the non-executed asynchronous task is not the dependency type and the latency type, the computer device adds the non-executed asynchronous task to a ready queue (indicated as B in fig. 4);
when the asynchronous task in the waiting queue meets the execution condition, the computer device adds the asynchronous task meeting the execution condition to the ready queue.
In the embodiment of the present application, the queues shown in fig. 4 represent different states of the asynchronous task, and the SDK may scan and modify the states of the asynchronous task. The relationship between the various task queues shown in FIG. 4 may be understood as the lifecycle of asynchronous tasks. The asynchronous tasks in the waiting queue (as indicated by a in fig. 4) are in a waiting state, and can be executed only when an execution condition is satisfied, where the execution condition may include waiting for a specified duration or waiting for the completion of the dependent tasks; asynchronous tasks in the ready queue (indicated as B in fig. 4) are in a state that can be executed immediately; asynchronous tasks in the execution queue (indicated as C in FIG. 4) are in a state of being executed; the asynchronous task in the success queue (indicated as D in fig. 4) is in a state of having been successfully executed; the asynchronous task in the retry queue (E in fig. 4) is in a state of waiting to be executed again after the execution fails; the asynchronous task in the death queue (indicated as F in fig. 4) is in a state of failed execution and will not be executed again.
In the embodiment of the application, when the asynchronous task flows among the task queues, in order to ensure the integrity of the asynchronous task, the operation required in the flow process of the asynchronous task is written into a script. For example, the process of adding an asynchronous task from a wait queue to a ready queue requires the action of taking the asynchronous task out of the wait queue and then performing the action of putting the asynchronous task into the ready queue. In the embodiment of the application, the two action commands of taking out and putting in are written into a script. The method and the device ensure that the operation of the asynchronous task in the circulation process is atomic (it can be understood that two action commands are executed or not executed), and the condition that the asynchronous task is lost due to the fact that the two action commands are executed respectively is avoided.
In the embodiment of the application, the state and the life cycle of the asynchronous task are reasonably set, and the circulation process of the asynchronous task is combined with atomic operation, so that the consistency of the asynchronous task when being processed and the reasonability of the current state are ensured.
In an embodiment of the present application, a method for executing an asynchronous task is provided, please refer to fig. 5, which includes the following steps:
step 501, when the idle thread exists, the computer device acquires asynchronous tasks from the ready queue according to the sequence added to the ready queue.
Optionally, the asynchronous tasks are fetched from the ready queue in an order of adding first and executing first. In the present application, when an idle thread exists locally and an asynchronous task that can be executed exists, the computer device will acquire the asynchronous task that can be executed. The status of the task in the ready queue is ready to be executed immediately, i.e. when the ready queue is not empty, it means that there is an asynchronous task that can be executed. If there is an idle thread at this time, the computer device may retrieve asynchronous tasks from the ready queue that may be executed.
Step 502, the computer device adds the acquired asynchronous task to an execution queue.
According to the method for the asynchronous task to flow in the task queue provided by the embodiment, the step can realize that the asynchronous task is added into the execution queue from the ready queue. And the SDK scans the state of the asynchronous task and modifies the state of the asynchronous task from executable state to executable state based on the method provided by the embodiment.
In step 503, the computer device executes the asynchronous tasks in the execution queue using the idle thread in the order of addition to the execution queue.
Optionally, the task queues in the execution queue are executed according to an order of adding first and executing first. Based on the above embodiment, the asynchronous task may have a class name of its task processing class, for example, the task processing class name of the asynchronous task is a borrowing class, and when the task is executed by using an idle thread, the asynchronous task is executed according to a preset logical manner of the borrowing class.
In the embodiment of the application, the order of processing the asynchronous tasks is reasonably set, the current state of the asynchronous tasks is timely scanned and changed, and thread resources are reasonably configured, so that the asynchronous tasks can be reasonably distributed to corresponding threads.
In an embodiment of the present application, a method for processing an executed asynchronous task is provided, please refer to fig. 6, which includes the following steps:
in step 601, the computer device obtains the result of the executed asynchronous task.
In the present application, after the asynchronous task is executed, there are different execution results, such as successful execution or failed execution. The computer device needs to perform different processing for different execution results. It is therefore necessary to first obtain the results of the asynchronous task being executed.
In step 602, the computer device determines whether the asynchronous task was executed successfully.
Step 603, when the asynchronous task is executed successfully, the computer device adds the successfully executed asynchronous task to the success queue; when the asynchronous task fails to be executed, the computer device adds the asynchronous task that failed to be executed to the retry queue.
Asynchronous tasks in the retry queue enter the ready queue to wait for re-execution;
in this step, the asynchronous task is executed successfully, which indicates that the life cycle of the asynchronous task has ended. When the asynchronous task fails to be executed, the asynchronous task is tried to be executed again. In practical applications, the asynchronous task may fail to be executed due to network instability, and the asynchronous task that failed to be executed needs to be re-executed. Optionally, the state of the asynchronous task is modified by the SDK to wait for the asynchronous task to be executed again, the asynchronous task that fails to be executed is added to the retry queue, the asynchronous task in the retry queue waits to be executed again, and when the asynchronous task in the retry queue can be executed, the asynchronous task enters the ready queue.
At step 604, the computer device obtains the number of times the asynchronous task was re-executed.
As time goes up, more and more asynchronous tasks need to be executed again, and if a large number of asynchronous tasks are executed again for many times but are not executed successfully, thread resources are wasted, and execution of other asynchronous tasks is also affected. Therefore, the number of times that the asynchronous task is re-executed needs to be obtained, and whether the asynchronous task needs to be executed again is further determined.
Step 605, when the number of times of the asynchronous task being executed again exceeds a first preset threshold, the computer device adds the asynchronous task whose number of times of being executed again exceeds the first preset threshold to the death queue.
Optionally, a threshold is preset as an upper limit of the number of times that the asynchronous task is re-executed, and if the threshold is 5, it indicates that, in the process of processing the asynchronous task, when a certain task is executed for 5 times, the execution result still fails, the asynchronous task will not be executed again, at this time, the asynchronous task may be added to a death queue, and the entry of the asynchronous task into the death queue indicates that the life cycle of the asynchronous task has ended.
In the embodiment of the application, asynchronous tasks with different execution results are correspondingly and differently processed, and the upper limit of retry times is set, so that the reasonability of thread resource allocation in a system is ensured to a certain extent.
In the embodiment of the present application, please refer to fig. 7, which provides an interface diagram of an asynchronous task management terminal. The computer equipment sends the number of the asynchronous tasks in the waiting queue, the ready queue, the execution queue, the success queue, the retry queue and the death queue to an asynchronous task management terminal so that the asynchronous task management terminal can display the number of the asynchronous tasks;
when the number of the asynchronous tasks in any one of the waiting queue, the ready queue, the execution queue, the success queue, the retry queue and the death queue exceeds a second preset threshold value, the computer equipment sends alarm information to the asynchronous task management terminal so that the asynchronous task management terminal can display the alarm information.
According to the method provided by the embodiment of the application, the current task queues and the number of asynchronous tasks contained in the task queues are visually displayed on the asynchronous task management terminal, and the asynchronous task management terminal can be shared by a plurality of services, such as banking services, school services or dining room services. The current asynchronous task processing situation of different services can be checked by triggering and selecting an application button (indicated by H in figure 7).
Optionally, a threshold may be preset as an upper limit of the number of asynchronous tasks accommodated by the task queue. When detecting that the number of asynchronous tasks in a certain task queue exceeds the upper limit of the number, corresponding alarm information can be given. For example, the upper limit of the number of asynchronous tasks accommodated by the task queue may be 4000, when the number of asynchronous tasks in a certain task queue exceeds 4000, as indicated by G in fig. 7, the number of asynchronous tasks in the successful queue at this time is 4331, and exceeds 4000, the asynchronous task management terminal may give a corresponding warning message, and optionally, the warning message may be a font that increases the number of asynchronous tasks included in the task queue name and the number of asynchronous tasks included in the task queue to increase the number of asynchronous tasks (as indicated by G in fig. 7).
It should be noted that fig. 7 only exemplarily shows a manner of displaying the alarm information, but the manner of displaying the alarm information is not specifically limited in the present application, for example, a dialog box may be popped up on the current interface, and the alarm information is displayed by using the dialog box, or other manners that the alarm information may be displayed on the asynchronous task management terminal interface.
In the embodiment of the present application, further, the processing procedure of the asynchronous task may be adjusted according to the state and quantity information of the current asynchronous task, for example, when the quantity of the asynchronous task in the success queue or the death queue is accumulated to a certain quantity, the task in the success queue or the death queue may be cleared, so as to prevent the situation of storage resource waste caused by excessive accumulation of the asynchronous task.
In the embodiment of the application, the asynchronous task processing process is monitored through the asynchronous task management terminal, the state and the quantity information of the current asynchronous task are known in time, then the asynchronous task processing process can be adjusted based on the quantity and the state information of the current asynchronous task, a plurality of services can share one asynchronous task management terminal, and the asynchronous task management process is simple and convenient to a certain extent.
In an embodiment of the present application, a method for acquiring an unexecuted asynchronous task is provided, please refer to fig. 8, which includes the following steps:
in step 801, the computer device obtains the type of the unexecuted asynchronous task.
When the computer device obtains the unexecuted asynchronous task, the computer device needs to obtain the type information of the unexecuted asynchronous task and also can obtain the class name of the task processing class of the asynchronous task. The type of asynchronous task and the class name of the asynchronous task processing class may be declared in advance by a software developer when developing an application.
The types of the unexecuted asynchronous tasks and the class names of the task processing classes have been described in detail in the above embodiments, and are not described herein again.
Step 802, the computer device stores the correspondence between the unexecuted asynchronous task and the type of the unexecuted asynchronous task in the task database.
Before computer equipment obtains an unexecuted asynchronous task from a database, the unexecuted asynchronous task needs to be stored in a task database, when the unexecuted asynchronous task is placed in the database, the type of the unexecuted asynchronous task is stored in the task database, and optionally, the class name of the task processing class of the unexecuted asynchronous task can be stored in the task database.
In the embodiment of the application, when the unexecuted asynchronous task is obtained, the type of the asynchronous task is obtained at the same time, and further, the class name of the task processing class of the asynchronous task is also obtained, so that different asynchronous tasks can be clearly distinguished, and the computer equipment can clearly perform corresponding operations according to the corresponding type and the corresponding task processing class name when processing the unexecuted asynchronous task in the subsequent process.
It should be understood that, although the steps in the flowcharts of fig. 2 to 8 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-8 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
In an embodiment of the present application, please refer to fig. 9, which provides an asynchronous task processing apparatus 900, including: a detection module 901, a first adding module 902 and an execution module 903, wherein:
a detecting module 901, configured to detect whether an unexecuted asynchronous task exists in a task database;
a first adding module 902, configured to, when it is detected that the unexecuted asynchronous task exists in the task database, add the unexecuted asynchronous task to a corresponding task queue according to the type of the unexecuted asynchronous task;
and an executing module 903, configured to execute, when there is an idle thread, the asynchronous task in the task queue by using the idle thread.
In this embodiment of the present application, the detecting module 901 is specifically configured to obtain a polling interval duration according to a preset interval duration and the number of clients in the system corresponding to the task database;
and polling and detecting whether the unexecuted asynchronous task exists in the task database or not according to the polling interval duration.
In this embodiment of the present application, the first adding module 902 is specifically configured to, when the type of the unexecuted asynchronous task is a dependency type or a delay type, add the unexecuted asynchronous task to the waiting queue, where the dependency type is used to characterize that the execution condition of the asynchronous task must be executed after the completion of the preceding task, and the delay type is used to characterize that the execution condition of the asynchronous task needs to wait for a certain time period before being executed;
when the type of the unexecuted asynchronous task is not a dependent type or a delay type, adding the unexecuted asynchronous task to a ready queue;
and when the asynchronous task in the waiting queue meets the execution condition, adding the asynchronous task meeting the execution condition into the ready queue.
In this embodiment of the application, the execution module 903 is specifically configured to, when the idle thread exists, obtain an asynchronous task from the ready queue according to an order added to the ready queue;
adding the obtained asynchronous task into an execution queue;
and executing the asynchronous tasks in the execution queue by using the idle thread according to the sequence added to the execution queue.
In the embodiment of the present application, please refer to fig. 10, another asynchronous task processing device 1000 is further provided, where the asynchronous task processing device 1000 includes, in addition to the modules included in the asynchronous task processing device 900, optionally, a second adding module 904, a sending module 905, and an obtaining module 906.
In this embodiment of the present application, the second adding module 904 is configured to, when the asynchronous task is successfully executed, add the successfully executed asynchronous task to the success queue;
when the asynchronous task fails to be executed, the asynchronous task which fails to be executed is added to a retry queue, and the asynchronous task in the retry queue enters the ready queue to wait for being executed again;
and when the number of times of the asynchronous tasks which are executed again exceeds a first preset threshold value, adding the asynchronous tasks which are executed again and exceed the first preset threshold value to the death queue.
In this embodiment of the application, the sending module 905 is configured to send the number of the asynchronous tasks in the wait queue, the ready queue, the execution queue, the success queue, the retry queue, and the death queue to an asynchronous task management terminal, so that the asynchronous task management terminal displays the number of the asynchronous tasks;
when the number of the asynchronous tasks in any one of the waiting queue, the ready queue, the execution queue, the success queue, the retry queue and the death queue exceeds a second preset threshold value, sending alarm information to the asynchronous task management terminal, so that the asynchronous task management terminal can display the alarm information.
In this embodiment of the application, the obtaining module 906 is configured to obtain a type of the unexecuted asynchronous task;
and storing the corresponding relation between the unexecuted asynchronous task and the type of the unexecuted asynchronous task into the task database.
For specific limitations of the asynchronous task processing device, reference may be made to the above limitations of the asynchronous task processing method, which are not described herein again. The respective modules in the asynchronous task processing device described above may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In the embodiment of the present application, a computer device is provided, where the computer device may be a terminal, and its internal structure diagram may be as shown in fig. 11. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement an asynchronous task processing method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 11 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In an embodiment of the present application, there is provided a computer device including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
detecting whether an unexecuted asynchronous task exists in a task database;
when the unexecuted asynchronous task exists in the task database, adding the unexecuted asynchronous task into a corresponding task queue according to the type of the unexecuted asynchronous task;
and when the idle thread exists, executing the asynchronous task in the task queue by using the idle thread.
In the embodiment of the present application, the processor, when executing the computer program, further implements the following steps:
acquiring polling interval duration according to preset interval duration and the number of clients in a system corresponding to the task database;
and polling and detecting whether the unexecuted asynchronous task exists in the task database or not according to the polling interval duration.
In the embodiment of the present application, the processor, when executing the computer program, further implements the following steps:
when the type of the unexecuted asynchronous task is a dependent type or a delay type, adding the unexecuted asynchronous task to a waiting queue, wherein the dependent type is used for representing that the execution condition of the asynchronous task can be executed only after the completion of a front task, and the delay type is used for representing that the execution condition of the asynchronous task can be executed only after waiting for a certain time;
when the type of the unexecuted asynchronous task is not a dependent type or a delay type, adding the unexecuted asynchronous task to a ready queue;
and when the asynchronous task in the waiting queue meets the execution condition, adding the asynchronous task meeting the execution condition into the ready queue.
In the embodiment of the present application, the processor, when executing the computer program, further implements the following steps:
when the idle thread exists, acquiring asynchronous tasks from the ready queue according to the sequence added to the ready queue;
adding the obtained asynchronous task into an execution queue;
and executing the asynchronous tasks in the execution queue by using the idle thread according to the sequence added to the execution queue.
In the embodiment of the present application, the processor, when executing the computer program, further implements the following steps:
when the asynchronous task is executed successfully, the successfully executed asynchronous task is added to a success queue;
when the asynchronous task fails to be executed, the asynchronous task which fails to be executed is added to a retry queue, and the asynchronous task in the retry queue enters the ready queue to wait for being executed again;
and when the number of times of the asynchronous tasks which are executed again exceeds a first preset threshold value, adding the asynchronous tasks which are executed again and exceed the first preset threshold value to the death queue.
In the embodiment of the present application, the processor, when executing the computer program, further implements the following steps:
sending the number of the asynchronous tasks in the waiting queue, the ready queue, the execution queue, the success queue, the retry queue and the death queue to an asynchronous task management terminal so that the asynchronous task management terminal can display the number of the asynchronous tasks;
when the number of the asynchronous tasks in any one of the waiting queue, the ready queue, the execution queue, the success queue, the retry queue and the death queue exceeds a second preset threshold value, sending alarm information to the asynchronous task management terminal, so that the asynchronous task management terminal can display the alarm information.
In the embodiment of the present application, the processor, when executing the computer program, further implements the following steps:
acquiring the type of the unexecuted asynchronous task;
and storing the corresponding relation between the unexecuted asynchronous task and the type of the unexecuted asynchronous task into the task database.
In an embodiment of the application, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, realizes the steps of:
detecting whether an unexecuted asynchronous task exists in a task database;
when the unexecuted asynchronous task exists in the task database, adding the unexecuted asynchronous task into a corresponding task queue according to the type of the unexecuted asynchronous task;
and when the idle thread exists, executing the asynchronous task in the task queue by using the idle thread.
In an embodiment of the application, the computer program when executed by the processor further performs the steps of:
acquiring polling interval duration according to preset interval duration and the number of clients in a system corresponding to the task database;
and polling and detecting whether the unexecuted asynchronous task exists in the task database or not according to the polling interval duration.
In an embodiment of the application, the computer program when executed by the processor further performs the steps of:
when the type of the unexecuted asynchronous task is a dependent type or a delay type, adding the unexecuted asynchronous task to a waiting queue, wherein the dependent type is used for representing that the execution condition of the asynchronous task can be executed only after the completion of a front task, and the delay type is used for representing that the execution condition of the asynchronous task can be executed only after waiting for a certain time;
when the type of the unexecuted asynchronous task is not a dependent type or a delay type, adding the unexecuted asynchronous task to a ready queue;
and when the asynchronous task in the waiting queue meets the execution condition, adding the asynchronous task meeting the execution condition into the ready queue.
In an embodiment of the application, the computer program when executed by the processor further performs the steps of:
when the idle thread exists, acquiring asynchronous tasks from the ready queue according to the sequence added to the ready queue;
adding the obtained asynchronous task into an execution queue;
and executing the asynchronous tasks in the execution queue by using the idle thread according to the sequence added to the execution queue.
In an embodiment of the application, the computer program when executed by the processor further performs the steps of:
when the asynchronous task is executed successfully, the successfully executed asynchronous task is added to a success queue;
when the asynchronous task fails to be executed, the asynchronous task which fails to be executed is added to a retry queue, and the asynchronous task in the retry queue enters the ready queue to wait for being executed again;
and when the number of times of the asynchronous tasks which are executed again exceeds a first preset threshold value, adding the asynchronous tasks which are executed again and exceed the first preset threshold value to the death queue.
In an embodiment of the application, the computer program when executed by the processor further performs the steps of:
sending the number of the asynchronous tasks in the waiting queue, the ready queue, the execution queue, the success queue, the retry queue and the death queue to an asynchronous task management terminal so that the asynchronous task management terminal can display the number of the asynchronous tasks;
when the number of the asynchronous tasks in any one of the waiting queue, the ready queue, the execution queue, the success queue, the retry queue and the death queue exceeds a second preset threshold value, sending alarm information to the asynchronous task management terminal, so that the asynchronous task management terminal can display the alarm information.
In an embodiment of the application, the computer program when executed by the processor further performs the steps of:
acquiring the type of the unexecuted asynchronous task;
and storing the corresponding relation between the unexecuted asynchronous task and the type of the unexecuted asynchronous task into the task database.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. An asynchronous task processing method, characterized in that the method comprises:
detecting whether an unexecuted asynchronous task exists in a task database;
when the fact that the unexecuted asynchronous task exists in the task database is detected, the unexecuted asynchronous task is added into a corresponding task queue according to the type of the unexecuted asynchronous task;
and when an idle thread exists, executing the asynchronous task in the task queue by using the idle thread.
2. The method of claim 1, wherein detecting whether there are non-executed asynchronous tasks in a task database comprises:
acquiring polling interval duration according to preset interval duration and the number of clients in the system corresponding to the task database;
and polling and detecting whether the unexecuted asynchronous task exists in the task database or not according to the polling interval duration.
3. The method of claim 1, wherein adding the asynchronous task to a corresponding task queue according to the type of the asynchronous task comprises:
when the type of the unexecuted asynchronous task is a dependent type or a delay type, adding the unexecuted asynchronous task to a waiting queue, wherein the dependent type is used for representing that the execution condition of the asynchronous task can be executed only after a front task is completed, and the delay type is used for representing that the execution condition of the asynchronous task can be executed only after a certain time length is needed to wait;
when the type of the unexecuted asynchronous task is not a dependent type or a delay type, adding the unexecuted asynchronous task to a ready queue;
and when the asynchronous task in the waiting queue meets the execution condition, adding the asynchronous task meeting the execution condition into the ready queue.
4. The method of claim 3, wherein executing the asynchronous task in the task queue with an idle thread when the idle thread exists comprises:
when the idle thread exists, acquiring asynchronous tasks from the ready queue according to the sequence added to the ready queue;
adding the obtained asynchronous task into an execution queue;
and executing the asynchronous tasks in the execution queue by using the idle threads according to the sequence added into the execution queue.
5. The method of claim 4, wherein after executing the asynchronous task in the execution queue with the idle thread, the method further comprises:
when the asynchronous task is executed successfully, the successfully executed asynchronous task is added to a success queue;
when the asynchronous task fails to be executed, the asynchronous task which fails to be executed is added to a retry queue, and the asynchronous task in the retry queue enters the ready queue to wait for being executed again;
and when the number of times of the asynchronous tasks which are executed again exceeds a first preset threshold value, adding the asynchronous tasks which are executed again and exceed the first preset threshold value to the death queue.
6. The method of claim 5, further comprising:
sending the number of the asynchronous tasks in the waiting queue, the ready queue, the execution queue, the success queue, the retry queue and the death queue to an asynchronous task management terminal so that the asynchronous task management terminal can display the number of the asynchronous tasks;
and when the number of the asynchronous tasks in any queue of the waiting queue, the ready queue, the execution queue, the success queue, the retry queue and the death queue exceeds a second preset threshold value, sending alarm information to the asynchronous task management terminal so that the asynchronous task management terminal can display the alarm information.
7. The method of claim 1, wherein prior to detecting whether there are non-executing asynchronous tasks in the task database, the method further comprises:
acquiring the type of the unexecuted asynchronous task;
and storing the corresponding relation between the unexecuted asynchronous task and the type of the unexecuted asynchronous task into the task database.
8. An asynchronous task processing apparatus, characterized in that the apparatus comprises:
the detection module is used for detecting whether the unexecuted asynchronous task exists in the task database;
the first adding module is used for adding the unexecuted asynchronous task into a corresponding task queue according to the type of the unexecuted asynchronous task when the fact that the unexecuted asynchronous task exists in the task database is detected;
and the execution module is used for executing the asynchronous task in the task queue by using the idle thread when the idle thread exists.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 7 are implemented when the computer program is executed by the processor.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN201911058346.6A 2019-11-01 2019-11-01 Asynchronous task processing method and device, computer equipment and storage medium Active CN110990132B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911058346.6A CN110990132B (en) 2019-11-01 2019-11-01 Asynchronous task processing method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911058346.6A CN110990132B (en) 2019-11-01 2019-11-01 Asynchronous task processing method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110990132A true CN110990132A (en) 2020-04-10
CN110990132B CN110990132B (en) 2023-03-10

Family

ID=70082951

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911058346.6A Active CN110990132B (en) 2019-11-01 2019-11-01 Asynchronous task processing method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110990132B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111711598A (en) * 2020-04-23 2020-09-25 中国电子科技网络信息安全有限公司 Sensitive data detection system for large-scale SSL/TLS encrypted session stream
WO2022088082A1 (en) * 2020-10-30 2022-05-05 京东方科技集团股份有限公司 Task processing method, apparatus and device based on defect detection, and storage medium
CN115328670A (en) * 2022-06-27 2022-11-11 光大环境科技(中国)有限公司 Asynchronous task processing method, system and server

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080294769A1 (en) * 2007-05-25 2008-11-27 Kenshi Doi Efficient synchronization of agents starting a task where the agents poll a server to learn the task start time
US20120102500A1 (en) * 2010-10-25 2012-04-26 Samsung Electronics Co., Ltd. Numa aware system task management
US20120243057A1 (en) * 2011-03-22 2012-09-27 Fuji Xerox Co., Ltd. Information processing apparatus, computer readable medium storing program, and information processing method
US20120297216A1 (en) * 2011-05-19 2012-11-22 International Business Machines Corporation Dynamically selecting active polling or timed waits
CN103473138A (en) * 2013-09-18 2013-12-25 柳州市博源环科科技有限公司 Multi-tasking queue scheduling method based on thread pool
CN105389209A (en) * 2015-12-25 2016-03-09 中国建设银行股份有限公司 Asynchronous batch task processing method and system
US20160094945A1 (en) * 2014-09-26 2016-03-31 Sunil Kulkarni Variable interval for periodic fix requests of multiple clients
CN106126354A (en) * 2016-06-21 2016-11-16 中国建设银行股份有限公司 A kind of asynchronous batch processing method and system
CN106506389A (en) * 2016-10-19 2017-03-15 广州华多网络科技有限公司 Network request asynchronous processing method and device
CN108874513A (en) * 2017-05-11 2018-11-23 北京京东尚科信息技术有限公司 Handle method, system, electronic equipment and the computer-readable medium of timed task
US20180341527A1 (en) * 2017-05-29 2018-11-29 Fujitsu Limited Task deployment method, task deployment apparatus, and storage medium
CN109558255A (en) * 2018-12-13 2019-04-02 广东浪潮大数据研究有限公司 A kind of method and Task Processing Unit of task processing
CN110119305A (en) * 2019-05-13 2019-08-13 北京达佳互联信息技术有限公司 Task executing method, device, computer equipment and storage medium

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080294769A1 (en) * 2007-05-25 2008-11-27 Kenshi Doi Efficient synchronization of agents starting a task where the agents poll a server to learn the task start time
US20120102500A1 (en) * 2010-10-25 2012-04-26 Samsung Electronics Co., Ltd. Numa aware system task management
US20120243057A1 (en) * 2011-03-22 2012-09-27 Fuji Xerox Co., Ltd. Information processing apparatus, computer readable medium storing program, and information processing method
US20120297216A1 (en) * 2011-05-19 2012-11-22 International Business Machines Corporation Dynamically selecting active polling or timed waits
CN103473138A (en) * 2013-09-18 2013-12-25 柳州市博源环科科技有限公司 Multi-tasking queue scheduling method based on thread pool
US20160094945A1 (en) * 2014-09-26 2016-03-31 Sunil Kulkarni Variable interval for periodic fix requests of multiple clients
CN105389209A (en) * 2015-12-25 2016-03-09 中国建设银行股份有限公司 Asynchronous batch task processing method and system
CN106126354A (en) * 2016-06-21 2016-11-16 中国建设银行股份有限公司 A kind of asynchronous batch processing method and system
CN106506389A (en) * 2016-10-19 2017-03-15 广州华多网络科技有限公司 Network request asynchronous processing method and device
CN108874513A (en) * 2017-05-11 2018-11-23 北京京东尚科信息技术有限公司 Handle method, system, electronic equipment and the computer-readable medium of timed task
US20180341527A1 (en) * 2017-05-29 2018-11-29 Fujitsu Limited Task deployment method, task deployment apparatus, and storage medium
CN109558255A (en) * 2018-12-13 2019-04-02 广东浪潮大数据研究有限公司 A kind of method and Task Processing Unit of task processing
CN110119305A (en) * 2019-05-13 2019-08-13 北京达佳互联信息技术有限公司 Task executing method, device, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
PETER SANDERS: "Asynchronous Random Polling Dynamic Load Balancing", 《ALGORITHMS AND COMPUTATION 》 *
夏振华: "延迟队列系统DelayQue的设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111711598A (en) * 2020-04-23 2020-09-25 中国电子科技网络信息安全有限公司 Sensitive data detection system for large-scale SSL/TLS encrypted session stream
CN111711598B (en) * 2020-04-23 2022-07-05 中国电子科技网络信息安全有限公司 Sensitive data detection system for large-scale SSL/TLS encrypted session stream
WO2022088082A1 (en) * 2020-10-30 2022-05-05 京东方科技集团股份有限公司 Task processing method, apparatus and device based on defect detection, and storage medium
CN115328670A (en) * 2022-06-27 2022-11-11 光大环境科技(中国)有限公司 Asynchronous task processing method, system and server
CN115328670B (en) * 2022-06-27 2023-11-17 光大环境科技(中国)有限公司 Asynchronous task processing method, system and server

Also Published As

Publication number Publication date
CN110990132B (en) 2023-03-10

Similar Documents

Publication Publication Date Title
US11210109B2 (en) Method and system for loading resources
CN109960582B (en) Method, device and system for realizing multi-core parallel on TEE side
CN110990132B (en) Asynchronous task processing method and device, computer equipment and storage medium
CN107766101B (en) Method, device and equipment for processing App starting event
CN107491346B (en) Application task processing method, device and system
CN108848142B (en) Message pushing method and device, computer equipment and storage medium
CN108446172B (en) Data calling method and device, computer equipment and storage medium
CN107045475B (en) Test method and device
CN110765288B (en) Image information synchronization method, device and system and storage medium
CN112612988A (en) Page processing method and device, computer equipment and storage medium
CN111831414A (en) Thread migration method and device, storage medium and electronic equipment
CN110971700A (en) Method and device for realizing distributed lock
CN111831434A (en) Resource allocation method, device, storage medium and electronic equipment
US11074112B2 (en) Maintaining the responsiveness of a user interface while performing a synchronous operation
CN111831432B (en) IO request scheduling method and device, storage medium and electronic equipment
CN115408117A (en) Coroutine operation method and device, computer equipment and storage medium
CN112256421A (en) Communication processing method, communication processing device, storage medium and electronic equipment
CN111831436A (en) Scheduling method and device of IO (input/output) request, storage medium and electronic equipment
CN111831439A (en) IO request processing method and device, storage medium and electronic equipment
CN111399999A (en) Computer resource processing method and device, readable storage medium and computer equipment
CN115509861A (en) Process monitoring method, system, computer device and storage medium
CN111831409B (en) Thread scheduling method and device, storage medium and electronic equipment
CN114647411A (en) Programming interface loading method and device, electronic equipment and storage medium
CN110866011B (en) Data table synchronization method and device, computer equipment and storage medium
US10936475B2 (en) Automated scripting and testing system

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
GR01 Patent grant
GR01 Patent grant