CN106156198B - Task execution method and device based on distributed database - Google Patents

Task execution method and device based on distributed database Download PDF

Info

Publication number
CN106156198B
CN106156198B CN201510194020.1A CN201510194020A CN106156198B CN 106156198 B CN106156198 B CN 106156198B CN 201510194020 A CN201510194020 A CN 201510194020A CN 106156198 B CN106156198 B CN 106156198B
Authority
CN
China
Prior art keywords
task
execution
atomic
target
distributed database
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
Application number
CN201510194020.1A
Other languages
Chinese (zh)
Other versions
CN106156198A (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.)
Alibaba Cloud Computing Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201510194020.1A priority Critical patent/CN106156198B/en
Publication of CN106156198A publication Critical patent/CN106156198A/en
Application granted granted Critical
Publication of CN106156198B publication Critical patent/CN106156198B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The application provides a task execution method and a task execution device based on a distributed database, wherein the method comprises the following steps: a task execution process, the task execution process comprising: acquiring a target task meeting a preset execution condition from the distributed database in real time; executing the target task according to the relevant execution information and task type of the target task; wherein the task type of the target task is used to represent an operation type for the distributed database. By adopting the method or the device of the embodiment of the application, the operation and the maintenance of the distributed database can be automatically realized, and the efficiency and the accuracy of the task execution of the distributed database in the operation and the maintenance process are improved.

Description

Task execution method and device based on distributed database
Technical Field
The present application relates to the field of databases, and in particular, to a task execution method and apparatus based on a distributed database.
Background
Distributed Database systems typically use smaller computer systems, each of which may be individually located in a single location, with one complete copy, or a partial copy, of the DBMS in each computer, and with its own local Database, with many computers located in different locations interconnected via a network to form a complete, globally logically centralized, physically distributed, large Database.
Taking the oceanbase cluster as an example, in practical application, the distributed database needs to be operated and maintained, for example, the oceanbase cluster needs to be installed, upgraded, expanded, offline, configured, restarted, and the like.
Disclosure of Invention
However, the inventor finds in the research process that all tasks need to be performed by manually logging in the corresponding server when the distributed database is maintained. When the number of oceanbase clusters and the number of servers in the distributed database are small, there may not be a problem, but when the number of oceanbase clusters or the number of servers is increased, the total number of steps to be manually executed is increased, and the operation and maintenance difficulty is greatly increased, which not only causes the operation and maintenance efficiency to be very low, but also is very easy to cause operation errors.
The technical problem to be solved by the application is to provide a task execution method based on a distributed database, so as to avoid the phenomenon that the operation and maintenance of the distributed database are performed in a manual mode in the prior art as much as possible, thereby automatically realizing the operation and maintenance of the distributed database, and further improving the efficiency and accuracy of task execution of the distributed database in the operation and maintenance process.
The application also provides a task execution device based on the distributed database, which is used for ensuring the realization and the application of the method in practice.
In order to solve the above problem, the present application discloses a task execution method based on a distributed database, including a task execution process, where the task execution process includes:
acquiring a target task meeting a preset execution condition from a distributed database in real time; wherein, the distributed database stores the relevant execution information of the task;
executing the target task according to the relevant execution information and task type of the target task; wherein the task type of the target task is used to represent an operation type for the distributed database.
The application discloses task execution device based on distributed database includes: a task execution unit, the task execution unit comprising: the acquisition module is used for acquiring a target task meeting a preset execution condition from a distributed database in real time; wherein, the distributed database stores the relevant execution information of the task;
the execution module is used for executing the target task according to the relevant execution information and the task type of the target task; wherein the task type of the target task is used to represent an operation type for the distributed database.
Compared with the prior art, the method has the following advantages:
in the embodiment of the application, the execution of the target task can be triggered after the input information of the user is received, and in the process of executing the task, if a certain task fails to be executed, the atomic task at the failed part can be continuously executed without starting to execute the task from the beginning, so that the efficiency of task execution is relatively high. Meanwhile, as the number of oceanbase clusters or servers of the distributed database is increased, especially when the number of oceanbase clusters or servers reaches the scale degree, the efficient automatic task execution effect is more obvious. Further, in the embodiment of the present application, the distributed database oceanbase is not required to stop the service in the task execution process, which is also significant to the online production environment.
Of course, it is not necessary for any product to achieve all of the above-described advantages at the same time for the practice of the present application.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive labor.
FIG. 1 is a flow diagram of an embodiment of a distributed database based task execution method of the present application;
FIG. 2 is a diagram of an application scenario architecture in a practical application of an embodiment of the method of the present application;
fig. 3 is a block diagram of an embodiment of a distributed database based task execution device according to the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The application is operational with numerous general purpose or special purpose computing device environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multi-processor apparatus, distributed computing environments that include any of the above devices or equipment, and the like.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
Referring to fig. 1, a flowchart of an embodiment of a distributed database-based task execution method according to the present application is shown, where the embodiment may include the following steps:
step 101: and responding to input information submitted by a user, and generating an initial task to be executed according to a preset task format.
The method flow of the embodiment of the application may include a preprocessing flow and a task execution flow, which may be independent from each other. The preprocessing flow comprises steps 101 to 102, and the task execution flow comprises steps 103 to 104.
In step 101, a user may enter information, for example, information related to a new task, through an interactive interface. Assume that the new task entered by the user is: when a mass database (oceanbase) cluster is newly built, the related information of the new task that can be input by the user may include: the method comprises the steps of generating an initial task to be executed, namely a task for newly building an oceanbase cluster according to a preset task format according to input information, wherein the initial task to be executed is generated according to the input information, namely the task for newly building the oceanbase cluster. It is understood that, when generating the initial task to be executed, the content may be preset to the task format according to a preset task format, for example, what operation a certain field in the initial task represents is preset, or a format of transmission data is preset, or other content that needs to be preset, so as to subsequently generate a command to be executed according to the task format.
In practical applications, in the case of receiving the input information of the user, it can also be determined whether the input information of the user is reasonable, for example, whether the input information is computer-readable content, or whether the content input by the user is not scrambled code, and the like. If the input information of the user is unreasonable, prompting the user that the input is wrong; and if the input information of the user is reasonable, constructing the initial task according to a preset task format.
Referring next to fig. 2, a diagram of a scene architecture in practical application of the embodiment of the method of the present application is shown. In fig. 2, step 101 and step 102 may be performed by an actual control group (OBCONTROL) 201. The OBCONTROL is a user-oriented interactive system, and can receive input information of a user.
Then, returning to fig. 1, enter step 102: persistently storing the relevant execution information of the initial task into a distributed database; the related execution information includes: the input information submitted by the user.
In this step, the OBCONTROL may further persistently store the relevant execution information of the initial task in the distributed database 202 (shown in fig. 2), where the relevant execution information may be task information generated by the input information submitted by the user in step 101 according to an agreed format, where the task information includes the input information submitted by the user. Of course, the execution information of the related initial task may also be included, for example, the execution state of the initial task, which may include: whether the initial task starts to be executed or not, whether the execution is finished or not, whether the task is successfully executed or not and the like. Of course, the distributed database may also persistently store the initial task that the user needs to execute and other execution details of the initial task, such as a log generated during the execution of the initial task, execution time information of the initial task, and so on.
It is understood that, in practical applications, step 101 and step 102 do not need to be executed each time a task is triggered, and only the relevant execution information of the task is stored in the distributed database in advance. Therefore, in the present embodiment, when the distributed database stores the relevant execution information of the task in advance, only step 103 to step 104 may be included.
Entering step 103: and acquiring the target task meeting the preset execution condition from the distributed database in real time.
This step may be performed by the TASK engine 201 in fig. 2. After the TASK engine is started, the distributed database can be searched in real time to obtain an initial TASK to be executed.
Specifically, the query process of the TASK engine may include:
step A1: a plurality of threads is created.
In practical applications, the TASK engine may query the distributed database in a multi-threaded manner to improve the query efficiency, and first create multiple threads.
Step A2: triggering the multiple threads in real time according to the execution state of the initial task and searching the distributed database in parallel: a target task that has reached a specified execution time, and a target task that needs to continue execution after the execution fails.
And then triggering a plurality of threads to search the initial task to be executed from the distributed database in parallel. Because the execution state of the initial task is stored in the distributed database, the initial task to be executed may include: a target task that has reached a specified execution time, and a target task that needs to continue execution after the execution fails. If there is no initial TASK to be executed, the TASK engine may continue to query the distributed database until a target TASK meeting the execution conditions is queried.
Step 104: executing the target task according to the relevant execution information and task type of the target task; wherein the task type of the target task is used to represent an operation type for the distributed database.
When the TASK to be executed is queried by the TASK engine, the target TASK can be executed according to the relevant execution information and TASK type of the target TASK. Here, this step may be implemented by the TASK engine 203 and the TASK execution module 204 in fig. 2 together.
The TASK engine 203 may analyze the queried target TASK to obtain a TASK type of the target TASK, where the TASK type may include types of installation of an oceanbase cluster, upgrade of the oceanbase cluster, expansion of the oceanbase cluster, offline of a single machine of the oceanbase cluster, offline of an entire oceanbase cluster, configuration of distribution on the oceanbase cluster, restart of the oceanbase cluster, and the like. And, the TASK engine 203 refers to the relevant execution information of the target TASK again to trigger the execution of the target TASK.
Specifically, the step 104 may specifically include, in an implementation process:
step B1: and determining a first atomic task of the target task according to the task type of the target task and whether the target task is a new task, wherein the atomic task is a first executed subtask in the target task.
In this step, the TASK engine 203 determines the first atomic TASK of the target TASK according to the TASK type of the target TASK and relevant execution information, for example, whether the target TASK is a new TASK. In practical application, one target task can be split into a plurality of atomic tasks which are as irrelevant as possible to execute. Of course, the related execution information of the target task may also include: whether the task has already executed but failed to execute, if the task failed to execute, whether to resume execution of the task from scratch or continue execution of the task at the failure. For a new task (i.e., a task that has never been executed), the first atomic task is initialization, and for a non-new task, the first atomic task needs to be determined according to whether the command can continue to be executed from the failure, and if the command cannot be executed from the failure, the first atomic task is also initialization, and if the command can be executed from the failure, the first atomic task is the failed atomic task.
Step B2: and generating an atomic task state machine of the target task according to the first atomic task.
After determining the first atomic TASK of the target TASK, the TASK engine sends the target TASK, the TASK type, and the first atomic TASK of the target TASK to a TASK execution module 204 (shown in fig. 2) corresponding to the TASK type, respectively, for execution, and then the TASK engine continues to query the distributed database for the next round of processing. And after each TASK execution module is started, the target TASK sent by the TASK engine is monitored. And if the target task is not sent, performing the next round of monitoring, and if the command to be executed is sent, acquiring the target task and the first atomic task thereof, and further executing the target task in the mode of the atomic task. Firstly, in the step, the task execution module generates an atomic task state machine of the target task according to the first atomic task of the target task. The atomic task of the target task refers to that a large task is divided into a plurality of small tasks, each small task represents one atomic task, and the irrelevance between the atomic tasks of the same target task is ensured as much as possible. The specific division mode can be set by a person skilled in the art according to different task types.
Step B3: triggering, in the atomic task state machine, execution of the target task according to the first atomic task, including: triggering execution of the first atomic task in the atomic task state machine; and judging whether the first atomic task is successfully executed, if so, entering the step B4, and if not, entering the step B5.
The task execution module triggers the target task to enter an atomization task state machine to start executing a first atomic task and judges whether the first atomic task is executed successfully.
Step B4: and determining and executing a second atomic task of the target task according to result data generated by executing the first atomic task, and so on until the last atomic task of the target task is successfully executed.
If the first atomic task is successfully executed, determining and executing a second atomic task of the atomic task state machine according to result data generated by the first atomic task, then judging whether the second atomic task is successfully executed, if so, continuing to determine and execute a third atomic task of the atomic task state machine according to result data generated by the second atomic task, and executing in a circulating manner until the last atomic task of the target task is successfully executed (namely, the state of the atomic task state machine is reached), and jumping out of the atomic task state machine; or if one atomic task fails to execute halfway, the method also enters the step B5 to jump out of the atomic task state machine. And after the atomic task state machine is jumped out, the execution period of a target task is ended.
Step B5: and if any atomic task of the target task fails to execute, jumping out of the atomic task state machine.
To facilitate the detailed understanding of the specific process for executing the target task by those skilled in the art, taking the task type that the target task is installed in the oceanbase cluster as an example, the first atomic task is "init _ ctx," the context data structure of the state machine of the atomic task is initialized, and if the first atomic task is successfully executed, the second atomic task is determined as follows: "install _ init _ info" is data information when initializing oceanbase cluster installation; and then executing a second atomic task, and if the second atomic task is successfully executed, determining that a third atomic task is: "is _ process _ active" judging whether oceanbase process already exists on the distributed server; and then executing a third atomic task, and if the third atomic task is successfully executed, determining that a fourth atomic task is: "is _ disk _ used" judging whether the disk on the distributed server is used; and then executing a fourth atomic task, and if the fourth atomic task is successfully executed, determining that the fifth atomic task is: "install _ rpm: install oceanbase program on the allocated server"; and then executing a fifth atomic task, and if the fifth atomic task is successfully executed, determining that the sixth atomic task is: "stop _ ob" stopping oceanbase process on the allocated server; and then executing a sixth atomic task, and if the sixth atomic task is successfully executed, determining that the seventh atomic task is: "clean _ ob" is used to clean oceanbase data existing on the allocated server; and then executing a seventh atomic task, and if the seventh atomic task is successfully executed, determining that the eighth atomic task is: "init _ ob" is that the oceanbase process is initialized on the distributed server to make the oceanbase process run normally; and then executing an eighth atomic task, and if the eighth atomic task is successfully executed, determining that the ninth atomic task is: "install _ cron: installing a timed task on an allocated server"; and then executing a ninth atomic task, and if the ninth atomic task is successfully executed, determining that the tenth atomic task is: "install _ alarm: install alarm on distributed server"; and then executing a tenth atomic task, and if the tenth atomic task is successfully executed, determining that the eleventh atomic task is: "operation _ account" is to create an account on the installed oceanbase cluster; and then executing the eleventh atomic task, and if the eleventh atomic task is successfully executed, determining that the twelfth atomic task is: the atomization task state machine enters a final state and does some cleaning work.
And for other task types, such as oceanbase cluster upgrading, oceanbase cluster expansion, oceanbase cluster single offline, oceanbase cluster overall offline, oceanbase cluster configuration issuing, oceanbase cluster restarting and other task types, a large task can be divided into a plurality of atomic tasks according to the task types installed in the oceanbase cluster, the atomic tasks are sequentially executed, the atomic tasks are skipped out of the atomization task state machine when the atomic tasks which fail to be executed are encountered, and otherwise, the tasks are executed all the time until the atomic task state machine is in a final state.
It can be understood that, in order to track the execution state and the execution result of each atomic task of the target task, in the case that the atomic task of the target task is successfully executed, the method may further include:
step B6: and storing the result data of the successfully executed atomic task into the distributed database according to the target task to which the result data belongs.
In each atomic task execution process, if the execution is successful, the result data generated in the atomic task execution process, such as: and information such as an execution log, context information of execution, execution time, an execution result and the like is inserted into the distributed database so as to facilitate the OBCONTROL to track the details of task execution. Specifically, each atomic task may be inserted into the distributed database according to a target task to which the atomic task belongs, and the distributed database may store relevant information of all atomic tasks under the task with the target task as a dimension.
Similarly, in the case that the atomic task execution of the target task fails, the method may further include:
step B7: and storing the information of the atomic task execution failure of the target task into the distributed database according to the target task to which the information belongs.
Of course, in the execution process of each atomic task, if the execution fails, the information of the execution failure of the atomic task may also be stored in the distributed database, so that the target task corresponding to the subsequent atomic task may be executed continuously at the failure.
Then, since the atomic tasks before the atomic task have been successfully executed before the execution of the atomic task fails, in the case that the execution of the atomic task fails, the method may further include:
step B8: and re-executing the atomic task with the execution failure according to the result data of the successful execution of the previous atomic task of the atomic task with the execution failure.
Still taking the task type of oceanbase cluster installation as an example, assuming that the execution of the 4 th atomic task fails, the 4 th atomic task may be re-executed according to the result data of the successful execution of the 3 rd atomic task stored in the distributed database, without re-executing from the 1 st atomic task.
It can be understood that the distributed database in the embodiment of the present application is mainly used for storing tasks that users need to execute and details of task execution, where the details of task execution may include whether a task is successfully executed, in which atomic task the task fails to be executed, a log generated during task execution, a context after execution of each atomic task of each task is finished, a start time of execution of each atomic task of each task, an end time of execution of each atomic task of each task, and the like. Wherein, the context environment for finishing the execution of the atomic task comprises: the status of the current oceanbase cluster, the status parameters of the current command execution, the information needed for the next atomization task execution, etc.
In practical applications, optionally, before step 101, the method may further include:
step 100: judging whether the input information submitted by the user indicates to execute a new task, if so, entering a step 101; if not, step 105 is entered.
After receiving the input information of the user, the OBCONTROL first determines whether the input information indicates that a new task needs to be executed, if the new task is executed, the step 101 is performed, and if the new task is not executed, the task execution details are queried, the OBCONTROL may continue to query the detailed information of the task execution required by the user from the distributed database according to the input information of the user, and present the detailed information to the user on the interface.
Step 105: and inquiring corresponding detail data from the distributed database according to the input information for displaying.
And further showing the detail data inquired in the distributed database to the user. For example, the execution state of a certain task, or the execution result, etc.
Therefore, in the embodiment of the application, the execution of the target task can be triggered after the input information of the user is received, and in the process of executing the task, if a certain task fails to be executed, the atomic task at the failed part can be continuously executed without starting to execute the task from the beginning, so that the efficiency of executing the task is relatively high. Meanwhile, as the number of oceanbase clusters or servers of the distributed database is increased, especially when the number of oceanbase clusters or servers reaches the scale degree, the efficient automatic task execution effect is more obvious. Further, in the embodiment of the present application, the distributed database oceanbase is not required to stop the service in the task execution process, which is also significant to the online production environment.
For simplicity of explanation, the foregoing method embodiments are described as a series of acts or combinations, but those skilled in the art will appreciate that the present application is not limited by the order of acts, as some steps may occur in other orders or concurrently with other steps based on the disclosure herein. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
Corresponding to the method provided by the embodiment of the task execution method based on the distributed database in the present application, referring to fig. 3, the present application also provides an embodiment of a task execution device based on the distributed database, and in this embodiment, the device may include: a preprocessing unit 30 and a task execution unit 31, wherein,
the preprocessing unit 30 may include a generating module 301 and a storing module 302, where the generating module 301 is configured to generate an initial task to be executed according to a preset task format in response to input information submitted by a user; the storage module 302 is configured to persistently store the relevant execution information of the initial task into a distributed database; the related execution information includes: an execution state of the initial task.
The task execution unit 31 may include: the obtaining module 311 is configured to obtain, in real time, a target task meeting a preset execution condition from the distributed database; an executing module 312, configured to execute the target task according to the relevant execution information and task type of the target task; wherein the task type of the target task is used to represent an operation type for the distributed database.
Wherein the obtaining module 311 may include:
the creating submodule is used for creating a plurality of threads; and the first triggering sub-module is used for triggering the plurality of threads in real time to search the distributed database according to the execution state of the initial task: a target task that has reached a specified execution time, and a target task that needs to continue execution after the execution fails.
Wherein the executing module 312 may include:
the determining submodule is used for determining a first atomic task of the target task according to the task type of the target task and whether the target task is a new task, wherein the atomic task is a first executed subtask in the target task; the generating submodule is used for generating an atomic task state machine of the target task according to the first atomic task; a second triggering submodule, configured to trigger, in the atomic task state machine, execution of the target task according to the first atomic task, where the second triggering submodule includes: triggering execution of the first atomic task in the atomic task state machine; judging whether the first atomic task is successfully executed, if so, determining and executing a second atomic task of the target task according to result data generated by executing the first atomic task, and so on until the last atomic task of the target task is successfully executed; and the ending submodule is used for jumping out of the atomic task state machine if any one atomic task of the target task fails to execute.
Wherein the executing module 312 may further include:
the first storage submodule is used for storing the result data of the atomic task which is successfully executed into the distributed database according to the target task to which the result data belongs; and the second storage submodule is used for storing the information of the atomic task execution failure of the target task into the distributed database according to the target task to which the information belongs.
Wherein the executing module 312 may further include:
and the re-triggering submodule is used for re-executing the atomic task with the execution failure according to the result data of the successful execution of the previous atomic task of the atomic task with the execution failure.
Wherein the preprocessing unit 30 may further include:
a judging module 300, configured to judge whether input information submitted by a user indicates execution of a new task;
the triggering module 303 is configured to trigger the generating module if the result of the determining module is yes;
and the display module 304 is configured to, if the result of the determining sub-module is negative, query the corresponding detail data from the distributed database according to the input information for display.
In the embodiment of the application, the execution of the target task can be triggered after the input information of the user is received, and in the process of executing the task, if a certain task fails to be executed, the atomic task at the failed part can be continuously executed without starting to execute the task from the beginning, so that the efficiency of task execution is relatively high. Meanwhile, as the number of oceanbase clusters or servers of the distributed database is increased, especially when the number of oceanbase clusters or servers reaches the scale degree, the efficient automatic task execution effect is more obvious. Further, in the embodiment of the present application, the distributed database oceanbase is not required to stop the service in the task execution process, which is also significant to the online production environment.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The method and the device for task execution based on the distributed database provided by the present application are introduced in detail, and a specific example is applied in the present application to explain the principle and the implementation of the present application, and the description of the above embodiment is only used to help understand the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (14)

1. A task execution method based on a distributed database is characterized by being applied to computer equipment; the method comprises the following steps: a task execution process, the task execution process comprising:
acquiring a target task meeting a preset execution condition from a distributed database in real time; wherein, the distributed database stores the relevant execution information of the task;
executing the target task according to the relevant execution information and task type of the target task; wherein the task type of the target task is used to represent an operation type for the distributed database.
2. The method of claim 1, further comprising: a pretreatment process, the pretreatment process comprising:
responding to input information submitted by a user, and generating an initial task to be executed according to a preset task format;
persistently storing the relevant execution information of the initial task into a distributed database; the related execution information includes: the input information submitted by the user.
3. The method of claim 2, wherein the relevant performance information further comprises: an execution state of the initial task; the obtaining, in real time, a target task meeting a preset execution condition from the distributed database includes:
creating a plurality of threads;
triggering the multiple threads in real time according to the execution state of the initial task and searching the distributed database in parallel: a target task that has reached a specified execution time, and a target task that needs to continue execution after the execution fails.
4. The method of claim 2, wherein the executing the target task according to the relevant execution information and task type of the target task comprises:
determining a first atomic task of the target task according to the task type of the target task and whether the target task is a new task, wherein the atomic task is a first executed subtask in the target task;
generating an atomic task state machine of the target task according to the first atomic task;
triggering, in the atomic task state machine, execution of the target task according to the first atomic task, including: triggering execution of the first atomic task in the atomic task state machine; judging whether the first atomic task is successfully executed, if so, determining and executing a second atomic task of the target task according to result data generated by executing the first atomic task, and so on until the last atomic task of the target task is successfully executed;
and if any atomic task of the target task fails to execute, jumping out of the atomic task state machine.
5. The method of claim 4, further comprising, in the event that execution of the atomic task of the target task is successful:
storing the result data of the successfully executed atomic task into the distributed database according to the target task to which the result data belongs;
in case of failure of execution of the atomic task of the target task, the method further includes:
and storing the information of the atomic task execution failure of the target task into the distributed database according to the target task to which the information belongs.
6. The method of claim 5, wherein in case of a failure of an atomic task to execute, further comprising:
and re-executing the atomic task with the execution failure according to the result data of the successful execution of the previous atomic task of the atomic task with the execution failure.
7. The method of claim 2, wherein the preprocessing process further comprises:
judging whether the input information submitted by the user indicates to execute the new task, if so, executing the step of generating an initial task to be executed according to a preset task format; and if not, inquiring corresponding detail data from the distributed database according to the input information for display.
8. A task execution device based on a distributed database is characterized by being arranged on computer equipment; the device includes: a task execution unit, the task execution unit comprising:
the acquisition module is used for acquiring a target task meeting a preset execution condition from a distributed database in real time; wherein, the distributed database stores the relevant execution information of the task;
the execution module is used for executing the target task according to the relevant execution information and the task type of the target task; wherein the task type of the target task is used to represent an operation type for the distributed database.
9. The apparatus of claim 8, further comprising a pre-processing unit comprising: the system comprises a generating module and a storage module, wherein the generating module is used for responding to input information submitted by a user and generating an initial task to be executed according to a preset task format; the storage module is used for persistently storing the related execution information of the initial task into a distributed database; the related execution information includes: the input information submitted by the user.
10. The apparatus of claim 9, wherein the related execution information further comprises: in the execution state of the initial task, the obtaining module includes:
the creating submodule is used for creating a plurality of threads;
the first triggering submodule is used for triggering the threads to search the distributed database in parallel according to the execution state of the initial task: a target task that has reached a specified execution time, and a target task that needs to continue execution after the execution fails.
11. The apparatus of claim 9, wherein the execution module comprises:
the determining submodule is used for determining a first atomic task of the target task according to the task type of the target task and whether the target task is a new task, wherein the atomic task is a first executed subtask in the target task;
the generating submodule is used for generating an atomic task state machine of the target task according to the first atomic task;
a second triggering submodule, configured to trigger, in the atomic task state machine, execution of the target task according to the first atomic task, where the second triggering submodule includes: triggering execution of the first atomic task in the atomic task state machine; judging whether the first atomic task is successfully executed, if so, determining and executing a second atomic task of the target task according to result data generated by executing the first atomic task, and so on until the last atomic task of the target task is successfully executed;
and the ending submodule is used for jumping out of the atomic task state machine if any one atomic task of the target task fails to be executed.
12. The apparatus of claim 11, wherein the execution module further comprises:
the first storage submodule is used for storing the result data of the atomic task which is successfully executed into the distributed database according to the target task to which the result data belongs;
and the second storage submodule is used for storing the information of the atomic task execution failure of the target task into the distributed database according to the target task to which the information belongs.
13. The apparatus of claim 12, wherein the execution module further comprises:
and the re-triggering submodule is used for re-executing the atomic task with the execution failure according to the result data of the successful execution of the previous atomic task of the atomic task with the execution failure.
14. The apparatus of claim 9, wherein the pre-processing unit further comprises:
the judging module is used for judging whether the input information submitted by the user represents the execution of a new task;
the triggering module is used for triggering the generating module under the condition that the judgment module has a positive result;
and the display module is used for inquiring the corresponding detailed data from the distributed database according to the input information for displaying under the condition that the result of the judging submodule is negative.
CN201510194020.1A 2015-04-22 2015-04-22 Task execution method and device based on distributed database Active CN106156198B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510194020.1A CN106156198B (en) 2015-04-22 2015-04-22 Task execution method and device based on distributed database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510194020.1A CN106156198B (en) 2015-04-22 2015-04-22 Task execution method and device based on distributed database

Publications (2)

Publication Number Publication Date
CN106156198A CN106156198A (en) 2016-11-23
CN106156198B true CN106156198B (en) 2019-12-27

Family

ID=57346308

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510194020.1A Active CN106156198B (en) 2015-04-22 2015-04-22 Task execution method and device based on distributed database

Country Status (1)

Country Link
CN (1) CN106156198B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107784479A (en) * 2017-02-16 2018-03-09 平安科技(深圳)有限公司 A kind of business flow processing method and apparatus
CN108255588A (en) * 2017-03-13 2018-07-06 平安科技(深圳)有限公司 A kind of automation layout method for scheduling task and device
CN109445928A (en) * 2018-11-14 2019-03-08 郑州云海信息技术有限公司 A kind of access request processing method, device, equipment and readable storage medium storing program for executing
CN109785042A (en) * 2018-12-13 2019-05-21 深圳平安财富宝投资咨询有限公司 Abnormality eliminating method, server, storage medium and the device of distributed deployment
CN110825391B (en) * 2019-10-31 2023-10-13 北京金山云网络技术有限公司 Service management method, device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103377075A (en) * 2012-04-28 2013-10-30 腾讯科技(深圳)有限公司 Task management method, device and system
CN103685402A (en) * 2012-09-17 2014-03-26 联想(北京)有限公司 Method for remote resource control, server and task originating device
CN103902646A (en) * 2013-12-27 2014-07-02 北京天融信软件有限公司 Distributed task managing system and method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012071552A2 (en) * 2010-11-24 2012-05-31 Coral Networks, Inc. System and method for access control and identity management

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103377075A (en) * 2012-04-28 2013-10-30 腾讯科技(深圳)有限公司 Task management method, device and system
CN103685402A (en) * 2012-09-17 2014-03-26 联想(北京)有限公司 Method for remote resource control, server and task originating device
CN103902646A (en) * 2013-12-27 2014-07-02 北京天融信软件有限公司 Distributed task managing system and method

Also Published As

Publication number Publication date
CN106156198A (en) 2016-11-23

Similar Documents

Publication Publication Date Title
CN106156198B (en) Task execution method and device based on distributed database
US20210342747A1 (en) Method and system for distributed deep machine learning
US10152382B2 (en) Method and system for monitoring virtual machine cluster
US9680893B2 (en) Method and system for event state management in stream processing
CN107016480B (en) Task scheduling method, device and system
CN104423960A (en) Continuous project integration method and continuous project integration system
CN108681598B (en) Automatic task rerun method, system, computer equipment and storage medium
CN106940671B (en) Method, device and system for monitoring running of task threads in cluster
CN112445598B (en) Task scheduling method and device based on quartz, electronic equipment and medium
CN111352797A (en) System and method for monitoring software application processes
CN104657158A (en) Method and device for processing business in business system
CN109144701A (en) A kind of task flow management method, device, equipment and system
Thanekar et al. Big Data and MapReduce Challenges, Opportunities and Trends.
Rahme et al. A software reliability model for cloud-based software rejuvenation using dynamic fault trees
CN110798339A (en) Task disaster tolerance method based on distributed task scheduling framework
Bolduc Lessons learned: Using a static analysis tool within a continuous integration system
CN105279065A (en) Method and apparatus for making statistics on test results in cloud test platform
CN110895485A (en) Task scheduling system
Liu et al. Supporting fault-tolerance in presence of in-situ analytics
CN106843822B (en) Execution code generation method and equipment
CN109766131B (en) System and method for realizing intelligent automatic software upgrading based on multithreading technology
CN116090780A (en) Control method, device, equipment and medium of weather forecast flow
CN112148420B (en) Abnormal task processing method based on container technology, server and cloud platform
WO2013114830A1 (en) Process prediction execution device and process prediction execution method
CN114518974A (en) Checkpoint recovery method, device, equipment and medium for data processing task

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20231218

Address after: Room 1-2-A06, Yungu Park, No. 1008 Dengcai Street, Sandun Town, Xihu District, Hangzhou City, Zhejiang Province

Patentee after: Aliyun Computing Co.,Ltd.

Address before: Box four, 847, capital building, Grand Cayman Island capital, Cayman Islands, UK

Patentee before: ALIBABA GROUP HOLDING Ltd.