CN113986495A - Task execution method, device, equipment and storage medium - Google Patents

Task execution method, device, equipment and storage medium Download PDF

Info

Publication number
CN113986495A
CN113986495A CN202111249414.4A CN202111249414A CN113986495A CN 113986495 A CN113986495 A CN 113986495A CN 202111249414 A CN202111249414 A CN 202111249414A CN 113986495 A CN113986495 A CN 113986495A
Authority
CN
China
Prior art keywords
strategy
task
execution
policy
executing
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.)
Pending
Application number
CN202111249414.4A
Other languages
Chinese (zh)
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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202111249414.4A priority Critical patent/CN113986495A/en
Publication of CN113986495A publication Critical patent/CN113986495A/en
Pending legal-status Critical Current

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The disclosure provides a task execution method, a task execution device, a task execution equipment and a storage medium, and relates to the technical field of computers, in particular to the technical field of software. The specific implementation scheme is as follows: responding to the starting of tasks included in the execution of services in a pipeline mode, if a preset detection condition is met, detecting whether a target adjustment strategy meeting a trigger opportunity exists in adjustment strategies bound in the pipeline mode, wherein the adjustment strategies are as follows: the strategy is used for adjusting the execution flow of the tasks included in the business; if so, executing the target adjustment strategy under the condition of meeting the execution condition of the target adjustment strategy; adjusting the execution flow of the tasks included in the business based on the execution result of the target adjustment strategy; and executing the tasks included in the service according to the adjusted execution flow. By applying the scheme provided by the embodiment of the disclosure, the efficiency of task execution can be improved.

Description

Task execution method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technology, and more particularly, to the field of software technology.
Background
In different scenarios, different jobs may be done based on different services. Each service may include a plurality of tasks, and the service may be implemented by executing the tasks. Specifically, the plurality of tasks may be executed according to a task execution flow defined by the pipeline.
Taking CI/CD (Continuous Integration/Continuous Delivery) service of a software product as an example, the CI/CD service is used to construct a code written by a developer into a software product capable of being deployed in an actual application environment, and the CI/CD service includes a plurality of tasks such as a code compiling task, a product testing task, and a product deployment task, and in this case, the plurality of tasks are generally executed according to a task execution flow specified by a pipeline, so as to implement the CI/CD service.
Disclosure of Invention
The disclosure provides a task execution method, a task execution device, a task execution equipment and a storage medium.
According to an aspect of the present disclosure, there is provided a task execution method including:
responding to the starting of tasks included in the execution of services in a pipeline mode, if a preset detection condition is met, detecting whether a target adjustment strategy meeting a trigger opportunity exists in adjustment strategies bound in the pipeline mode, wherein the adjustment strategies are as follows: the strategy is used for adjusting the execution flow of the tasks included in the business;
if so, executing the target adjustment strategy under the condition of meeting the execution condition of the target adjustment strategy;
adjusting the execution flow of the tasks included in the business based on the execution result of the target adjustment strategy;
and executing the tasks included in the service according to the adjusted execution flow.
According to an aspect of the present disclosure, there is provided a task execution device including:
a policy detection module, configured to respond to starting a task included in executing a service in a pipeline manner, if a preset detection condition is met, detect whether a target adjustment policy that meets a trigger time exists in adjustment policies bound in the pipeline manner, and if so, trigger a first policy execution module, where the adjustment policy is: the strategy is used for adjusting the execution flow of the tasks included in the business;
the first strategy execution module is used for executing the target adjustment strategy under the condition that the execution condition of the target adjustment strategy is met;
the flow adjusting module is used for adjusting the execution flow of the tasks included in the business based on the execution result of the target adjusting strategy;
and the task execution module is used for executing the tasks included in the service according to the adjusted execution flow.
According to an aspect of the present disclosure, there is provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the above task execution method.
According to an aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the above task execution method.
According to an aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the task execution method described above.
The scheme provided by the embodiment of the disclosure can improve the efficiency of task execution.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a schematic diagram of a task execution flow in a pipeline manner according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a first task execution method according to an embodiment of the present disclosure;
fig. 3a is a schematic flowchart of a second task execution method according to an embodiment of the present disclosure;
fig. 3b is a schematic diagram of a policy link according to an embodiment of the present disclosure;
fig. 4a is a schematic flowchart of a third task execution method according to an embodiment of the present disclosure;
fig. 4b is a schematic structural diagram of a task execution system according to an embodiment of the present disclosure;
fig. 5a is a schematic flowchart of a fourth task execution method according to an embodiment of the present disclosure;
FIG. 5b is a schematic diagram of a problem handling system according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a micro service architecture according to an embodiment of the present disclosure;
fig. 7a is a schematic flowchart of a fifth task execution method according to an embodiment of the present disclosure;
FIG. 7b is a block diagram of a task execution method according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a first task execution device according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of a second task execution device according to an embodiment of the present disclosure;
fig. 10 is a schematic structural diagram of a third task execution device according to an embodiment of the present disclosure;
fig. 11 is a schematic structural diagram of a fourth task execution device according to an embodiment of the present disclosure;
FIG. 12 is a block diagram of an electronic device for implementing a task execution method of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
First, an application scenario of the present disclosure will be explained.
The application scenario of the present disclosure is: the application scenarios of the tasks comprised by the service are executed in a pipelined manner.
Taking CI/CD services as an example, the CI/CD services include code compiling tasks, product testing tasks, product deployment tasks, and the like. Each task may include multiple subtasks, for example, a code compiling task includes: a compiling algorithm subtask is called, a code input subtask is input, a compiling result subtask is obtained, and the like.
The pipeline approach specifies the execution flow of tasks included in the business. Taking fig. 1 as an example, fig. 1 shows a task execution flow in a pipeline manner, and a plurality of tasks included in a service can be executed according to the flow shown in fig. 1 from the start of the pipeline to the end of the pipeline. In fig. 1, the tasks from left to right are: task 1, task 2, and task … … are executed in sequence according to the execution flow of task 1, task 2, and task N … … when the tasks are executed.
Each task comprises the following subtasks in sequence: starting the subtask, running the subtask, and ending the subtask. Therefore, when each task is executed, the sub-task is executed first, so that the task is started, then the sub-task is executed, so that the task is executed, and finally the sub-task is executed and the task execution is finished.
Next, the execution body of the embodiment of the present disclosure will be explained.
The execution subject of the embodiments of the present disclosure may be any electronic device having a task execution function. For example, the electronic device may be a device in a task building center.
The following specifically describes a task execution method provided by the embodiments of the present disclosure.
Referring to fig. 2, fig. 2 is a schematic flowchart of a first task execution method according to an embodiment of the present disclosure. The above method includes the following steps S201 to S204.
Step S201: and responding to the starting of the tasks included in the execution of the services in the pipeline mode, and if the preset detection condition is met, detecting whether a target adjustment strategy meeting the trigger time exists in the adjustment strategies bound in the pipeline mode. If yes, step S202 is executed, and if not, after the detection condition is satisfied again, whether the target adjustment policy satisfying the trigger timing exists may be re-detected.
The service may include a plurality of tasks, and the implementation of the service depends on the execution of the tasks. When the plurality of tasks are executed, the tasks can be executed according to the task execution flow specified in a pipeline mode.
The above-mentioned detection condition refers to a condition for triggering policy detection. This detection condition may specify when policy detection is to be performed to detect that the target adjustment policy for the trigger opportunity is satisfied.
Specifically, the task execution process may be divided into different stages, and then different detection conditions may be set for the different stages, which are described in the following through three specific cases.
In a first case, the detection condition may be that the service is in a task preparation phase, where the task preparation phase may be understood as: a phase in which the service has been started, but has not yet started to execute the tasks comprised by the service. Therefore, the strategy detection can be carried out before all tasks are executed, and the reference data can be provided for adjusting the execution flow of the tasks before the tasks are executed, so that the execution flow can be adjusted before the tasks are executed.
In case two, the detection condition may be that the service is in a task execution phase, where the task execution phase may be understood as: a phase of executing any task comprised by the business. For example, if it is detected that a task is triggered to start, it may be considered that the service is in a task execution stage and meets the detection condition. Therefore, strategy detection can be carried out in the task execution process, reference data is further provided for adjusting the execution flow of the task in the task execution process, and dynamic adjustment of the execution flow in the task execution process is facilitated.
In a third case, the detection condition may be that the service is in a task ending phase, where the task ending phase may be understood as: and a phase of ending execution of any task included in the business. For example, if it is detected that a task is finished, the service may be considered to be in a task end stage, and the detection condition is satisfied. Therefore, strategy detection can be carried out after one task is finished, reference data is further provided for adjustment of the execution flow of the subsequent task, and the execution flow of the subsequent task is optimized.
The adjustment strategy is as follows: and the strategy is used for adjusting the execution flow of the tasks included in the business.
In one embodiment, the adjustment policy may include an analysis policy and a decision policy, where the analysis policy refers to a policy for analyzing a task; the decision-making strategy refers to a strategy for adjusting the execution flow of the task based on the analysis result. The analysis result used by the decision-making strategy may be a result obtained by performing task analysis on the decision-making strategy, or a result obtained by performing task analysis on the analysis-making strategy.
Other forms of adjustment strategies are described in the following embodiments and will not be described in detail here.
The trigger timing refers to a timing when the adjustment strategy is triggered to be executed. May be set together when binding the adjustment policy for pipelining.
The trigger timings of different adjustment strategies may be the same or different, and the specific form of the trigger timing is described in the following embodiments, which will not be described in detail here.
Step S202: and executing the target adjustment strategy under the condition that the execution condition of the target adjustment strategy is met.
After the trigger time of the target adjustment strategy is met, the target adjustment strategy can be triggered to be executed, but the execution of the target adjustment strategy may need to meet certain execution conditions, and after the trigger time is met, if the execution conditions of the target adjustment strategy are not met, the target adjustment strategy is still difficult to execute. For this reason, before the target adjustment policy is executed, it is necessary to make a judgment about the execution condition.
In view of the above, the execution conditions of the target adjustment policy are: the target adjustment strategy implements the conditions that need to be met. For example, the execution condition may include at least one of the following conditions: the policy on which the adjustment policy depends has been executed, the data on which the adjustment policy depends already exists, and so on.
In one embodiment, when executing the target adjustment policy, the target adjustment policy may be executed according to an execution flow defined by the target adjustment policy and parameter information configured in advance.
Other embodiments for implementing the target adjustment strategy can be seen in the following example corresponding to fig. 4a, and are not described in detail here.
Step S203: and adjusting the execution flow of the tasks included in the business based on the execution result of the target adjustment strategy.
The execution result may include: the task of the execution flow, the adjustment mode, and the like are adjusted. The above adjustment method may include: canceling the task, modifying parameters used in the task execution flow, multiplexing the execution results of other tasks, and the like.
In one embodiment, the execution flow may be adjusted according to the above adjustment manner.
Step S204: and executing the tasks included in the service according to the adjusted execution flow.
As can be seen from the above, in the solution provided in the embodiment of the present disclosure, the tasks included in the service are executed in a pipeline manner, and the adjustment policy is bound in the pipeline manner, so that when the tasks are executed, the target adjustment policy is detected and the target adjustment policy is conditionally executed in response to starting the execution of the tasks included in the service in the pipeline manner. Since the target adjustment policy is a policy for adjusting the execution flow of the task included in the service, the execution flow of the task can be adjusted based on the execution result of the target adjustment policy, and the task included in the service is executed according to the adjusted execution flow, so that the process of executing the task can be changed. Compared with the method for executing the task according to the fixed and unchangeable execution flow, the method for executing the task according to the embodiment of the disclosure changes the task execution process into the dynamic execution process, enriches the task execution flow, and improves the flexibility of task execution, thereby improving the efficiency of task execution.
In addition, the scheme provided by the embodiment of the disclosure changes the process of executing the task into a dynamic execution process, and in the process, the tasks occupying too much resources, such as invalid tasks, redundant tasks and the like, can be effectively reduced by executing the adjustment strategy, so that the effective utilization rate of the task execution resources is improved.
Next, another form of adjusting the policy in step S201 will be described.
In an embodiment of the present disclosure, the adjustment policy may include at least one of the following policies: the task information analysis strategy, the task skipping strategy, the task ordering strategy, the task canceling strategy and the task execution result multiplexing strategy.
The task information analysis strategy is as follows: the policy for analyzing the task information includes, for example, analyzing source code used by the service, analyzing an execution flow of task execution, and the like.
The task skip strategy is: a policy for skipping tasks; for executing a task-skipping policy prior to executing the task. In the process of executing the task skipping strategy, whether the task needs to be executed or not can be judged, and if the task does not need to be executed, the task is skipped.
The task ordering strategy is as follows: a policy for ordering tasks; the method is used for executing the task ordering strategy before executing a plurality of tasks of the same type. In the process of executing the task ordering strategy, the tasks can be prioritized and queued according to the ordering result.
The task cancellation policy is: a policy for cancelling execution of the task; and executing the task canceling strategy before or during the task execution. In the process of executing the task canceling strategy, whether the task to be executed or the task being executed needs to be canceled is judged, and if yes, the task to be executed or the task being executed is canceled.
The multiplexing strategy of the task execution result is as follows: a policy for multiplexing execution results of the tasks; the multiplexing strategy is used for executing the multiplexing strategy before or during the task execution. In the process of executing the multiplexing strategy, whether the task to be executed or the task being executed needs to use the execution result of other tasks can be judged, and if so, the execution result of other tasks is multiplexed.
The other tasks may be other tasks included in the same service; in the case where tasks included in a plurality of services are executed in parallel, the other tasks may be tasks included in other services that are executed in parallel.
The adjustment strategy comprises at least one of a task information analysis strategy, a task skipping strategy, a task sequencing strategy, a task canceling strategy and a task execution result multiplexing strategy, so that the adjustment strategy is richer, and the obtained execution result is richer and comprehensive when the adjustment strategy is executed subsequently.
The adjustment policy in step S201 is a policy bound in advance for a pipeline mode corresponding to the service. The policy may specifically be bound for the pipeline approach described above in the following manner.
The strategy configurator can select the adjustment strategy stored in the strategy middle station through a user interaction interface provided by the task execution system, and set information such as trigger time, dependence strategy of the selected strategy and the like for the selected adjustment strategy, and the electronic equipment in the task execution system binds the selected adjustment strategy and the set information to a pipeline mode corresponding to the service.
In addition, the policy configurator can also upload the adjustment policy to the policy middlebox through the user interaction interface, set information such as trigger time, dependence policy of the selected policy and the like for the uploaded adjustment policy, and the electronic device in the task execution system binds the uploaded adjustment policy and the set information to a pipeline mode corresponding to the service.
The strategy middle desk is used for storing the adjustment strategy. The specific structure of the task execution system can be seen in the following embodiments, and will not be detailed here.
The trigger timing in step S201 will be described below.
In an embodiment of the present disclosure, the trigger timing may include at least one of the following timings: before the first task included in the service is executed, in the process of executing the task included in the service, after the task included in the service is executed and ended.
When the trigger time of the adjustment strategy is as follows: the "before the first task included in the service is executed" means that the execution of the adjustment policy may be triggered when the service is started but the execution of the task included in the service is not started. Since the execution of the adjustment policy is triggered before the start of the execution of all tasks, reference data can be provided for the execution flow of the adjustment task before the start of the execution of the task. The adjustment strategy of which the trigger opportunity is 'before the first task included in the execution of the service' is called a pre-strategy.
When the trigger time of the adjustment strategy is as follows: the term "in the process of executing a task included in a service" means that the execution of the adjustment policy may be triggered in the process of executing any task included in the service. The execution of the adjustment strategy is triggered in the task execution process, so that the reference data is provided for the execution flow of the task in the task execution process. The adjustment policy in which the trigger timing is "in the process of executing the task included in the service" is referred to as a real-time policy.
When the trigger time of the adjustment strategy is as follows: the term "after executing a task included in the end service" means that after executing any task included in the end service, execution of the adjustment policy may be triggered. Because the execution of the adjustment strategy is triggered after the execution of the task is finished, reference data is provided for the execution flow of the subsequent task. The adjustment policy in which the trigger timing is "after the execution of the task included in the end service" is referred to as a post-policy.
Because "before the first task included in the execution service" indicates that all pre-task stages are executed, "in the process of executing the task included in the service" indicates that any task stage is executed, "after the task included in the execution completion service" indicates that any task is executed, the three stages are different stages of executing the task included in the service in a pipeline manner, based on which, the adjustment policy may be bound to the respective stages, and the trigger timing of the adjustment policy may be set for the respective stages, for example, the trigger timing of the adjustment policy may be: before, during, and after the bound phase.
On the basis of the above, the trigger granularity of the adjustment policy can be considered as the above stages.
In addition, as can be seen from the above description, the process of executing tasks included in the service in a pipelined manner may be divided into different stages, each of which may last for a period of time, and thus, each stage may include a plurality of tasks.
Before the first task included in the service is executed, in the process of executing the task included in the service, the three trigger times after the task included in the service is executed and finished cover the complete execution process of executing the task included in the service in a pipeline mode, and the target adjustment strategy meeting the trigger times is distributed in the complete execution process of executing the task included in the service, so that the execution flow of the task in the complete execution process can be adjusted based on the target adjustment strategy.
In a pipelined bundled adjustment strategy, there may be dependencies between adjustment strategies. For an adjustment strategy, if the adjustment strategy that it depends on is not executed, the adjustment strategy can not be executed for a while. Therefore, according to the above-described dependency relationship, it can be determined whether the detected target adjustment policy can be executed. Based on this, in one embodiment of the present disclosure, referring to fig. 3a, a flowchart of a second task execution method is provided. In this embodiment, in the embodiment shown in fig. 2, the following step S306 may be further included to execute the tasks included in the service in a pipelined manner in response to the start. In addition to step S306, step S202 shown in fig. 2 can be implemented as step S302 to step S303 described below.
Specifically, the embodiment shown in fig. 3a includes the following steps S301 to S306.
Step S301: in response to starting the task included in the service executed in the pipeline manner, if a preset detection condition is met, detecting whether a target adjustment strategy meeting the trigger time exists in the adjustment strategies bound in the pipeline manner, and if so, executing step S302.
Wherein, the adjustment strategy is as follows: and the strategy is used for adjusting the execution flow of the tasks included in the business.
Step S301 is the same as step S201 shown in fig. 2, and will not be described herein again.
Step S306: and obtaining a policy link reflecting the dependency relationship between the bound adjustment policies of the pipeline mode.
The policy link may include nodes and connection relationships between the nodes, where the nodes are used to characterize the adjustment policies, and the connection relationships between the nodes are used to characterize the dependency relationships between the adjustment policies.
Taking fig. 3b as an example, fig. 3b shows a policy link. The policy link shown in fig. 3b includes 4 nodes, which are respectively: A. b, C, D, wherein the A, B, C, D is characterized by the following adjustment strategies: policy 1, policy 2, policy 3, policy 4. Arrows between nodes represent dependencies between the adjustment policies characterized by the nodes.
In fig. 3b, A, B point to C, indicating that the dependency between policy 3 and policy 1 and policy 2 is: the strategy 3 depends on the strategies 1 and 2, namely the strategy 3 can be executed only under the condition that the strategies 1 and 2 are executed;
c points to D, indicating that the dependency between policy 3 and policy 4 is: policy 4 is dependent on policy 3, i.e. policy 4 can only be executed if policy 3 is executed.
The number of policy links may be plural. In one embodiment, the adjustment policy for the pipeline-wise binding may correspond to a task included in the service. Based on this, each policy link may be a link for each task included in the service, reflecting the dependency relationship between the adjustment policies corresponding to the tasks.
The adjustment strategy can correspond to tasks included in the service, so that when the adjustment strategy is bound in a pipeline mode, the adjustment strategy can be specifically bound with each task, and on the basis, the trigger time of the adjustment strategy can be the trigger time aiming at the tasks, so that the granularity of the trigger time can be considered as the tasks.
The policy link may be pre-generated, so that the pre-generated policy link is directly obtained after the task included in the execution service is started. In addition, the policy link may be generated in real time after the tasks included in the service are started.
Specifically, when the policy link is generated, the dependency relationship between the adjustment policies bound by the pipeline may be determined, and then the policy link may be generated based on the determined dependency relationship.
The dependency between the above adjustment strategies can be determined in two different ways:
in the first embodiment, if another adjustment policy to which the adjustment policy depends is already configured for the adjustment policy, the adjustment policy may be provided with configuration information, and the dependency relationship between the adjustment policy and the other adjustment policy may be determined based on the configuration information.
For example: the configuration information set by the adjustment strategy contains strategy identifications of other adjustment strategies which are depended on by the adjustment strategy, the strategy identifications of the other adjustment strategies which are depended on by the adjustment strategy are obtained from the configuration information, and the dependency relationship between the adjustment strategy and the other adjustment strategies is determined based on the obtained strategy identifications.
In a second implementation manner, if other adjustment policies that depend on the adjustment policy are not configured for the adjustment policy, data required for executing the adjustment policy may be obtained, and if the data may be generated by other adjustment policies, it is determined that the other adjustment policies are policies that depend on the adjustment policy, so as to determine a dependency relationship between the adjustment policy and the other adjustment policies.
Step S302: and determining a dependence strategy of the target adjustment strategy according to the strategy link.
The above-mentioned dependency strategy refers to: the adjustment strategy on which the target adjustment strategy depends.
In one embodiment, when determining the dependency policy, a node corresponding to the target adjustment policy in the policy link may be determined, and an adjustment policy characterized by other nodes pointing to the node is determined as the dependency policy of the target adjustment policy.
The process of determining the dependency policy is described below in conjunction with FIG. 3b above. Assume that the corresponding nodes in the policy link shown in fig. 3b of the target adjustment policy are: and C, the nodes pointing to C are A and B, and the strategies respectively characterized by A and B are strategy 1 and strategy 2, so that the strategy 1 and the strategy 2 can be determined to be the dependence strategy of strategy 3.
Step S303: and executing the target adjustment strategy when the execution of the dependent strategy is finished.
If the dependent policy is not executed, the target adjustment policy may be executed after the dependent policy is executed.
And if the dependent strategy is executed, directly executing the target adjustment strategy.
Step S304: and adjusting the execution flow of the tasks included in the business based on the execution result of the target adjustment strategy.
Step S305: and executing the tasks included in the service according to the adjusted execution flow.
The steps S304 to S305 are respectively the same as the steps S203 and S204 shown in fig. 2, and are not described again here.
As can be seen from the above, since the dependent policy is the adjustment policy dependent on the target adjustment policy, and if the adjustment policy dependent on the dependent policy is not completely executed for one adjustment policy, the adjustment policy cannot be executed yet, the target adjustment policy is executed when the execution of the dependent policy is completed, so that the target adjustment policy can be successfully executed.
And because the strategy link reflects the dependency relationship between the adjustment strategies, the dependency strategy of the target adjustment strategy can be accurately determined according to the strategy link.
In addition to the manner of executing the target adjustment policy mentioned at step S202 in the foregoing embodiment shown in fig. 2, the target adjustment policy may also be executed in the manner mentioned in the embodiment shown in fig. 4a as follows, and in an embodiment of the present disclosure, referring to fig. 4a, a flowchart of a third task execution method is provided. In this embodiment, when the target adjustment policy is executed in the embodiment shown in fig. 2, the implementation may be performed according to the following steps S402 to S403.
Specifically, the embodiment shown in FIG. 4a includes the following steps S401-S405.
Step S401: in response to the start of executing the task included in the service in the pipeline manner, if a preset detection condition is met, detecting whether a target adjustment policy meeting the trigger time exists in the adjustment policies bound in the pipeline manner, and if so, executing step S402.
Wherein, the adjustment strategy is as follows: and the strategy is used for adjusting the execution flow of the tasks included in the business.
Step S401 is the same as step S201 shown in fig. 2, and is not described again here.
Step S402: in the case where the execution condition of the target adjustment policy is satisfied, the target adjustment policy is called from the policy center station, and the configuration data necessary for executing the target adjustment policy is obtained from the data center station.
The strategy middle desk is used for storing the adjustment strategy.
The data center station is used for storing configuration data required for executing the adjustment strategy stored by the strategy center station.
When the target adjustment policy is called, based on the target identifier of the target adjustment policy, the policy identified as the target identifier is read from the policy center station as the target adjustment policy, and the configuration data corresponding to the target adjustment policy is read from the data center station.
Step S403: based on the configuration data, a target adjustment policy is executed.
Step S404: and adjusting the execution flow of the tasks included in the business based on the execution result of the target adjustment strategy.
Step S405: and executing the tasks included in the service according to the adjusted execution flow.
The steps S404 to S405 are respectively the same as the steps S203 and S204 shown in fig. 2, and are not described again here.
As can be seen from the above, the policy center station stores the policy, and the data center station stores the configuration data required by the policy, so that the types of data stored in different center stations are different, which is convenient for managing various types of data. In addition, each middlebox stores each type of data, when the data is called from the middlebox, a certain type of data can be obtained from the middlebox, and compared with the method for calling the data from the middlebox storing all types of data, the method effectively reduces the problems of errors and the like when the data is called.
Taking an electronic device as an example of a device in a middle building station, a task execution system including the middle building station, a data middle station, and a policy middle station will be described below with reference to fig. 4 b. Fig. 4b is a schematic structural diagram of a task execution system according to an embodiment of the present disclosure.
The strategy middle desk is used for storing the adjustment strategy; the data center station is used for storing configuration data required by the strategy stored by the strategy center station; the method comprises the following steps of constructing a middle platform, integrating a plurality of services, and comprising: task execution service, policy execution service, problem handling service, policy testing service, policy feature analysis service, and the like.
When the electronic device calls the tasks included in the task execution service execution business, other services integrated in the middle platform can be called according to the specific situation of task execution, in the process of calling other services, if the strategy needs to be executed, the electronic device calls the needed strategy from the strategy middle platform, obtains the configuration data needed by the strategy from the data middle platform, and executes the strategy based on the configuration data.
As can be seen from the above, in the task execution system, operations such as policy testing, policy analysis, and the like can be implemented by the electronic device, and a policy developer does not need to waste energy for debugging and effect observation when configuring a policy, and does not need to consider other matters except the configuration policy, and can focus on development of policy contents, so that policy development is degraded to development of a script, cost required by policy configuration is reduced, and a threshold of policy configuration is lowered.
In order to solve the above problems, in an embodiment of the present disclosure, referring to fig. 5a, a flowchart of a fourth task execution method is provided. In this embodiment, after the target adjustment policy is executed in the embodiment shown in fig. 2, the following steps S505 to S507 are included.
Specifically, FIG. 5a includes the following steps S501-S507.
Step S501: and responding to the starting of the tasks included in the execution of the services in the pipeline mode, and if the preset detection condition is met, detecting whether a target adjustment strategy meeting the trigger time exists in the adjustment strategies bound in the pipeline mode. If yes, go to step S502.
Wherein, the adjustment strategy is as follows: and the strategy is used for adjusting the execution flow of the tasks included in the business.
Step S502: and executing the target adjustment strategy under the condition that the execution condition of the target adjustment strategy is met.
The steps S501 to S502 are respectively the same as the steps S201 and S202 in the embodiment shown in fig. 2, and are not described again here.
Step S505: an initiation instruction for a problem handling service is received.
The start-up instructions may be generated by a device capable of invoking a problem-handling service.
Specifically, the above-mentioned apparatus may be: electronic devices, devices in a plug-in center, devices in a pipeline platform, etc. The equipment in the plug-in center stores plug-ins required for executing tasks, and the equipment in the pipeline platform is used for providing services which need to be implemented in a pipeline mode.
Step S506: and executing the configured problem processing strategies according to the execution sequence of the configured problem processing strategies of the problem processing service to obtain a processing result.
The problem handling strategy is as follows: and the strategy is used for processing the problems in the task execution process.
The problem handling policies described above may be determined from alternative policies that have been configured by the problem handling service.
In one embodiment of the present disclosure, the problem handling policy may include at least one of the following policies: the problem analysis strategy, the problem processing priority determination strategy, the problem marking strategy, the problem self-healing strategy, the problem issuing strategy and the problem reporting strategy. The specific descriptions of the above strategies can be found in the following examples, which are not described in detail herein.
The order of execution of the issue processing policies may be determined based on dependencies between the issue processing policies. The determination manner of the dependency relationship of the problem handling policy may refer to the determination manner of the dependency relationship of the adjustment policy in the embodiment shown in fig. 3a, and is not described in detail here.
The processing result may include: cause of problems, treatment method, and the like. For example: the reasons for the problems are: the service source code has problems, and the processing mode is as follows: adjusting the service source code; the reasons for the problems are: the task plug-in of a certain task has problems, and the processing mode is as follows: and replacing the task plug-in.
Step S507: and processing problems existing in the execution flow of the tasks included in the execution service based on the processing result.
Specifically, the problem may be located based on the reason included in the processing result, and the problem may be processed by the processing method included in the processing result.
In one embodiment, problem handling may be implemented as follows:
and after the electronic equipment obtains the processing result, reporting the processing result to the problem positioning functional unit, so that the problem positioning functional unit can analyze the processing result and position the problems in the task execution flow, thereby realizing problem reporting. And then the problem positioning functional unit can send the positioned problems to the problem processing functional unit, so that the problem processing functional unit can process the problems in the task execution flow in a targeted manner, and the problem issuing is realized.
The problem location function unit and the problem processing function unit may be function units of the electronic device, or function units of other devices in the task execution system.
In the case of processing a problem in an execution flow of a task included in a service based on an execution result of the target adjustment policy, the execution flow of the task may be adjusted, for example: skipping a task, canceling a task, determining a task priority, etc., and therefore, the execution result of the above-described problem handling policy affects the execution flow of executing a task in a pipeline manner.
Under the condition that the process of executing the tasks included in the business is complex, because the electronic equipment provides the problem processing service, the execution process of the tasks included in the business is adjusted and the existing problems are processed based on the execution result of the problem processing strategy configured by the problem processing service, so that the problem processing process can form a closed-loop process, and the problem processing service can also be called as problem closed-loop service.
Step S503: and adjusting the execution flow of the tasks included in the business based on the execution result of the target adjustment strategy.
Step S504: and executing the tasks included in the service according to the adjusted execution flow.
Steps S503 to S504 are the same as steps S203 and S204 in the embodiment shown in fig. 2, and are not described again here.
As can be seen from the above, after receiving a start instruction for the problem handling service, the problem handling policies are executed according to the execution order of the problem handling policies, and since the problem handling policies are policies for handling problems occurring during the task execution process, problems existing in the execution flow of tasks included in the execution service can be handled based on the processing result of executing the problem handling policies. Compared with the problem processing by manual operation, the problem processing efficiency is obviously improved.
In an embodiment of the present disclosure, the problem processing policy in step S506 may include at least one of the following policies: the problem analysis strategy, the problem processing priority determination strategy, the problem marking strategy, the problem self-healing strategy, the problem issuing strategy and the problem reporting strategy.
Wherein, the problem analysis strategy is as follows: strategies for analyzing problems arising from task execution.
The question marking strategy is as follows: strategies for annotating problems that arise with task execution.
The problem handling priority determination strategy is as follows: a policy for determining a priority of handling of a plurality of problems.
The problem self-healing strategy is as follows: strategies for automatic repair of problems arising from task execution.
The problem issuing strategy is as follows: and the strategy is used for issuing the problems existing in the task execution flow to the problem processing functional unit. The problem processing functional unit may be a functional unit of the electronic device, a functional unit of another device in the task execution system, or a functional unit of a device in the problem processing system.
The problem reporting strategy can be as follows: and the problem positioning function unit is used for reporting the processing result to the problem positioning function unit. The problem location function unit may be a function unit of the electronic device, a function unit of another device in the task execution system, or a function unit of a device in the problem recording system.
The problem processing strategy comprises at least one of a problem analysis strategy, a problem processing priority determination strategy, a problem marking strategy, a problem self-healing strategy, a problem issuing strategy and a problem reporting strategy, so that the problem processing strategy is rich, and the obtained processing result is rich and comprehensive when the problem processing strategy is executed subsequently.
The procedure of the above problem handling will be described below with reference to fig. 5 b.
Fig. 5b is a schematic structural diagram of a problem handling system according to an embodiment of the present disclosure. In order from top to bottom, the first layer represents the problem handling policies configured by the problem handling service, the second layer represents the components used to implement the problem handling policies, and the third layer includes the data middleboxes and the alarm components.
In the first layer, the problem-handling strategy includes: the system comprises a problem analysis strategy, a problem processing priority determination strategy, a problem labeling strategy and a problem self-healing strategy.
In the process of executing the problem analysis strategy, the method comprises the steps of obtaining submission information, system analysis, intelligent analysis and classification labels.
Wherein, the obtaining of the submission information indicates receiving of a starting instruction of the problem processing service; the system analysis means that the task execution process is completely and systematically analyzed; the intelligent analysis means that a deep learning mode is adopted for analysis; the category label representation determines the type of problem and identifies the type of problem.
In the process of executing the problem processing priority determination strategy, the method comprises the steps of obtaining classification and source information, a priority strategy, distributing and queuing and initiating sub-services.
The acquisition classification and source information represents the type of the acquisition problem and the reason for the problem; the priority strategy represents the priority order of all the problems; distributing queuing means queuing the processing order of each question based on the priority order of each question; initiating a sub-service represents processing the problem based on the problem processing order.
In the process of executing the problem marking strategy, the method comprises the steps of obtaining information, requesting a log management system, reporting the problem, and performing label returning and self-healing.
Wherein the acquisition information indicates receiving a start instruction of the problem handling service; the request log management system is used for sending a problem processing request to the log management system; the problem reporting means that the detected problems are sent to the electronic equipment; and the label return and self-healing represent to perform processing such as labeling, self-healing repair and the like on the problem.
In the process of executing the problem self-healing strategy, the method comprises the steps of configuration loading, data assembling, duplicate removal filtering and problem reporting.
The configuration loading represents loading configuration data required for processing problems; data assembly means assembling configuration data required to handle the problem; the deduplication filtering represents that the result of the problem processing is subjected to deduplication filtering; and the problem reporting means that the detected problems are sent to the electronic equipment.
In the second layer, the components include a policy management component, a deduplication filter component, and a problem card template component. Each assembly includes various tools.
The strategy management component is divided into a management component for analyzing the strategy and a management component for positioning the strategy.
The management component of the analysis strategy comprises a problem characteristic analysis tool, a risk degree estimation tool, a problem priority analysis tool and a construction analysis suggestion tool.
The problem feature analysis tool is used for analyzing the features of the problems; the risk degree estimation tool is used for estimating risks caused by problems; the problem priority analysis tool is used for sequencing the priority of the problem; and constructing an analysis suggestion tool for proposing suggestions for the task execution process aiming at the problems.
The management component of the positioning strategy comprises a problem positioning tool, a repair suggestion tool, an accurate alarm tool and an automatic repair tool.
The problem positioning tool is used for positioning problems; a fix suggestion tool for determining a manner of modifying the problem; the accurate alarm tool is used for alarming aiming at problems; and the automatic repairing tool is used for repairing and processing the problems.
The duplicate removal filtering component comprises a problem type recognition tool, a problem feature analysis tool, a unique identification calculation tool and a system duplicate removal tool.
The problem type identification tool is used for identifying the type of a problem; the problem characteristic analysis tool is used for analyzing the characteristics of the obtained problems; a unique identification calculation tool for determining an identification of the problem; and the system duplicate removal tool is used for removing the duplicate of the reason of the problem.
The question card template component comprises a template configuration tool, a template analysis tool, a content filling tool and a card reporting tool.
The template configuration tool is used for configuring a template of the question card; the template analysis tool is used for analyzing the template of the problem card; the content filling tool is used for filling contents in the question card; and the card reporting tool is used for sending the configured problem card to the electronic equipment.
In the third layer, a data center station and an alarm component are included.
Wherein, the data center is used for storing the characteristic data, and the characteristic data includes: the code characteristics of the service initial code, the strategy characteristics of the adjustment strategy, the strategy characteristics of the problem processing strategy, the plug-in characteristics, the service characteristics and the like.
The alarm component is used for alarming and comprises a mail alarm tool, a data monitoring tool, a plug-in necessary field monitoring tool and a card creation and content replacement monitoring tool.
The mail alarming tool is used for alarming through mails; the data monitoring tool is used for monitoring data generated in the problem processing process; the plug-in necessary field monitoring tool is used for monitoring the plug-in necessary field when the plug-in is used; the card creation and content replacement monitoring tool is used for monitoring the process of creating and replacing the problem card.
Specifically, in the process of performing problem handling, the problem handling policies included in the first layer may be executed in the order of execution of the problem handling policies. In executing the problem handling policy described above, the components included in the second layer may be called. After the problem is processed, subsequent problem alarming can be carried out based on the alarming component in the third layer, and the characteristics of the data generated in the whole problem processing process are stored in the data center.
In order to improve the stability of task execution, in an embodiment of the present disclosure, a system architecture used by a task execution system may be a micro service architecture, and in the micro service architecture, a service guarantee mechanism is added, which can effectively guarantee the stability of a service operation process.
The service guarantee mechanism comprises: a load balancing mechanism, an overtime fusing mechanism, a monitoring & log collecting scheme, a caching mechanism, a service degradation measure, a caching updating mechanism, a strategy exception retry mechanism, a system bottom conflict processing mechanism and the like.
The micro-service architecture is described below with reference to fig. 6.
Fig. 6 is a schematic structural diagram of a micro service architecture according to an embodiment of the present disclosure. Fig. 6 includes a built middle station, a task scheduling, a registry, a monitoring system, a log system, a Remote Dictionary Server (Remote Dictionary Server) cluster, an XDB (Xbase DataBase), and an OS (Object Storage).
And constructing a middle platform for executing tasks included in the service in a pipeline mode. The built middle platform comprises a plurality of service guarantee mechanisms, such as a cache updating mechanism, a strategy exception retry mechanism, a task multi-timeout mechanism and a system bottom conflict processing mechanism.
A cache update mechanism for updating the data in the cache; a strategy exception retry mechanism used for executing the strategy with exception again; a task multi-timeout mechanism for determining a timeout condition occurring when a task is executed; and the system bottom conflict processing mechanism is used for processing the conflict of the tasks.
And the task scheduling is used for scheduling each task. The task scheduling also comprises a plurality of service guarantee mechanisms, such as a task distribution mechanism, a timeout fusing mechanism, a degradation mechanism and the like.
The task distribution mechanism is used for caching the task execution data; the overtime fusing mechanism is used for processing the overtime executed task; the degradation mechanism is used for processing service exception and key business.
The registry comprises a Zookeeper (reliable coordination system of distributed systems) cluster for service registration and service discovery. And the monitoring system is used for tracking the link and monitoring and alarming. And the log system is used for collecting logs.
And the Redis cluster is used for caching data. And the XDB is used for storing the service data. And the OS is used for storing the objects.
The micro-service architecture realizes load balancing and overtime fusing through a Dubbo (open source distributed service framework).
The following specifically describes the task execution method provided by the embodiment of the present disclosure with reference to fig. 7a and 7 b.
Fig. 7a is a schematic flowchart of a fifth task execution method according to an embodiment of the present disclosure. Fig. 7a includes the following steps S701-S710.
Step S701: the tasks involved in executing the service in a pipelined manner are initiated.
Step S702: and judging whether the pipeline mode is bound with an adjustment strategy or not, if so, executing the step S703, and if not, ending the process.
Step S703: and obtaining a policy link reflecting the dependency relationship between the bound adjustment policies of the pipeline mode.
Step S704: and based on the strategy link, sequentially calling and executing each adjustment strategy.
Step S705: and assembling and analyzing the strategy result of the execution strategy.
The analysis results include skipping tasks, canceling tasks, queuing tasks, and the like.
Step S706: and judging whether the plug-in of the task to be executed needs to be continuously triggered, if so, executing the step S707, and if not, ending the process.
Step S707: and triggering the plug-in to execute the task.
Step S708: after the task execution is finished, whether a problem processing policy is configured is judged, and if yes, step S709 is executed.
Step S709: and executing the problem processing strategy to obtain a problem processing result.
In this process, when the problem processing strategy is the synchronization strategy, the problem processing result is obtained by waiting for the completion of the execution of all the problem processing strategies.
Step S710: and processing the problem based on the problem processing result.
FIG. 7b is a block diagram of a task execution method. In fig. 7b, the first layer, the second layer and the third layer are divided from top to bottom, where the first layer includes operations to be performed to implement the business process, the second layer includes policies used to perform the operations of the first layer, and the third layer includes feature sets.
In the first layer, the operations to be performed to implement the business process include: feature analysis calculation, task scheduling execution, risk analysis calculation and problem intelligent closed loop.
And the characteristic analysis calculation is used for analyzing the characteristics of the task. The characteristic analysis calculation comprises the steps of obtaining submission information, requesting a strategy, assembling characteristics and warehousing the code characteristics.
Specifically, the submission information is obtained and used for receiving initial data, such as a source code and the like, for triggering service implementation; a request policy for requesting a feature analysis policy; the characteristic assembly is used for assembling the characteristics obtained by analysis; and the code feature storage is used for storing the features obtained by analysis into a feature set in the third layer.
And the task scheduling execution is used for scheduling the task. The task scheduling execution comprises the steps of acquiring task characteristics, requesting a strategy, making a task decision and initiating service.
Specifically, the task characteristics are obtained, which are used for obtaining the characteristics of the tasks included in the service; a request policy for requesting a task scheduling policy; the task decision is used for determining an adjusting mode of an execution flow of the task; and the initiating service is used for initiating the task execution service.
And risk analysis calculation is used for analyzing the risk of the task. The risk analysis calculation comprises the steps of constructing result collection, requesting a strategy, risk report recombination and problem reporting.
Specifically, the construction result collection is used for acquiring the execution result of the task included in the execution service; a request policy for requesting a risk analysis calculation policy; the risk report recombination is used for recombining the risk result; and the problem report is used for sending the problems to the electronic equipment.
And the problem intelligent closed loop is used for processing problems occurring in task execution. The problem intelligent closed loop comprises the steps of task information collection, strategy request, report recombination and alarm sending.
Specifically, task information collection is used for acquiring information of tasks included in the service; the request strategy is used for requesting the problem intelligent closed-loop calculation strategy; a reorganization report for reorganizing the problem; and sending an alarm for sending alarm information aiming at the problems.
In the operation of the first layer, the policy included in the second layer may be called.
The above strategies include: a characteristic calculation strategy, a task skip strategy, a task priority queuing strategy, an analysis strategy and a positioning strategy.
And the characteristic calculation strategy is used for carrying out characteristic analysis. The characteristic calculation strategy execution process can comprise the steps of solitary function analysis, risk-free function analysis, Tag (label) extraction, risk level analysis and the like;
and the task skip strategy is used for determining the strategy needing to be skipped. The process of executing the task skip strategy can comprise the steps of risk-free skip, intra-stage repeated skip, inter-stage repeated skip, invalid skip and the like.
Specifically, the risk-free skip refers to executing skip operation for a risk-free task; the step of repeating skip in the same step refers to that the repeated tasks in the same step execute skip operation; the inter-stage repeated skip refers to the operation of skipping and the like aiming at repeated tasks in different stages; an invalid skip refers to a task that has been determined to be skipped for cancellation.
And the task priority queuing strategy is used for determining the task execution priority. The process of executing the task priority queuing strategy can comprise the steps of queuing time estimation, problem finding capability estimation, priority factor estimation, fusing judgment and the like.
Specifically, the estimated queuing time refers to the estimated task processing time; the capability of predicting and finding problems refers to the problems which may occur when the predicted tasks are executed; the priority factor refers to a priority factor corresponding to the task; the fusing judgment refers to determining whether the execution of the task is overtime and deciding whether fusing is required based on the determination result.
And the analysis strategy is used for analyzing the task. The process of executing the analysis strategy can comprise the steps of risk report recombination, risk degree estimation, problem closed loop, supplementary construction suggestion and the like.
Specifically, the risk report reorganization refers to reorganization of the obtained risk results; the risk degree estimation refers to estimating the risk which is possibly generated during task execution; problem closed-loop refers to handling problems that may occur with task execution; the supplementary construction suggestion refers to the proposal of repair suggestion aiming at the problem of task execution.
And the positioning strategy is used for positioning the problem. The positioning strategy executing process can comprise the steps of problem positioning, repair suggestion, accurate alarm, automatic repair and the like.
Specifically, problem positioning refers to positioning problems occurring when a task is executed; the repair suggestion refers to determining a repair mode for repairing the problem; the accurate alarm is to alarm aiming at problems; automatic repair refers to the automatic repair of problems.
The third layer features are concentrated with stored feature data of various information, including tasks included in the service, codes used for implementing the service, functions used for analyzing the features, and the like. The characteristic data comprises: an orphan function, connectivity between tasks, code diff (code modification), auxiliary class code, unchanged behavior code, task name, task type, task phase, task historical execution duration, task stability, task historical queuing, task error type, submission risk dimension, report structured data, code submitter, submission association requirement priority.
Corresponding to the task execution method, the embodiment of the disclosure also provides a task execution device.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a first task execution device according to an embodiment of the present disclosure, where the device includes the following modules 801 and 804.
A policy detection module 801, configured to, in response to starting a task included in executing a service in a pipeline manner, if a preset detection condition is met, detect whether a target adjustment policy meeting a trigger time exists in adjustment policies bound in the pipeline manner, and if so, trigger a first policy execution module 802, where the adjustment policy is: the strategy is used for adjusting the execution flow of the tasks included in the business;
the first policy executing module 802 is configured to execute the target adjustment policy if an executing condition of the target adjustment policy is satisfied;
a flow adjusting module 803, configured to adjust an execution flow of a task included in the service based on an execution result of the target adjustment policy;
and a task execution module 804, configured to execute the task included in the service according to the adjusted execution flow.
As can be seen from the above, in the solution provided in the embodiment of the present disclosure, the tasks included in the service are executed in a pipeline manner, and the adjustment policy is bound in the pipeline manner, so that when the tasks are executed, the target adjustment policy is detected and the target adjustment policy is conditionally executed in response to starting the execution of the tasks included in the service in the pipeline manner. Since the target adjustment policy is a policy for adjusting the execution flow of the task included in the service, the execution flow of the task can be adjusted based on the execution result of the target adjustment policy, and the task included in the service is executed according to the adjusted execution flow, so that the process of executing the task can be changed. Compared with the method for executing the task according to the fixed and unchangeable execution flow, the method for executing the task according to the embodiment of the disclosure changes the task execution process into the dynamic execution process, enriches the task execution flow, and improves the flexibility of task execution, thereby improving the efficiency of task execution.
Referring to fig. 9, fig. 9 is a schematic structural diagram of a second task execution device according to an embodiment of the disclosure, where the device includes the following modules 901 and 906.
A policy detection module 901, configured to respond to starting a task included in executing a service in a pipeline manner, if a preset detection condition is met, detect whether a target adjustment policy meeting a trigger time exists in adjustment policies bound in the pipeline manner, and if so, trigger a policy determination sub-module 902, where the adjustment policies are: the strategy is used for adjusting the execution flow of the tasks included in the business;
the module 901 is the same as the module 801 in the embodiment shown in fig. 8.
A link obtaining module 906, configured to obtain a policy link reflecting a dependency relationship between adjustment policies that have been bound in a pipeline manner in response to starting a task included in executing a service in the pipeline manner;
a policy determining submodule 902, configured to determine, according to the policy link, a dependency policy of a target adjustment policy;
a first policy execution sub-module 903, configured to execute the target adjustment policy when the execution of the dependent policy is completed.
A flow adjusting module 904, configured to adjust an execution flow of a task included in the service based on an execution result of the target adjustment policy;
and a task execution module 905, configured to execute a task included in the service according to the adjusted execution flow.
The above-mentioned blocks 904-905 are the same as the blocks 803-804 in the embodiment shown in FIG. 8.
As can be seen from the above, since the dependent policy is the adjustment link on which the target adjustment policy depends, if the adjustment policy on which the dependent policy depends is not completely executed, the adjustment policy cannot be executed for a while, and therefore, the target adjustment policy is executed when the execution of the dependent policy is completed, so that the target adjustment policy can be successfully executed.
And because the strategy link reflects the dependency relationship between the adjustment strategies, the dependency strategy of the target adjustment strategy can be accurately determined according to the strategy link.
Referring to fig. 10, fig. 10 is a schematic structural diagram of a third task execution device according to an embodiment of the present disclosure, where the device includes the following modules 1001 and 1005.
A policy detection module 1001, configured to respond to starting a task included in executing a service in a pipeline manner, if a preset detection condition is met, detect whether a target adjustment policy meeting a trigger time exists in adjustment policies bound in the pipeline manner, and if so, trigger information to invoke a sub-module 1002, where the adjustment policy is: the strategy is used for adjusting the execution flow of the tasks included in the business;
the module 1001 is the same as the module 801 of the embodiment of figure 8.
An information invoking sub-module 1002, configured to invoke the target adjustment policy from a policy center station, and obtain configuration data required for executing the target adjustment policy from a data center station, where the policy center station is used to store policies, and the data center station is used to store the configuration data required for the policies stored by the policy center station;
a second policy execution sub-module 1003, configured to execute the target adjustment policy based on the configuration data;
a flow adjusting module 1004, configured to adjust an execution flow of a task included in the service based on an execution result of the target adjustment policy;
a task executing module 1005, configured to execute the task included in the service according to the adjusted execution flow.
The modules 1004 and 1005 are the same as the module 803 and 804 in the embodiment shown in FIG. 8.
As can be seen from the above, the policy center station stores the policy, and the data center station stores the configuration data required by the policy, so that the types of data stored in different center stations are different, which is convenient for managing various types of data. In addition, each middlebox stores each type of data, when the data is called from the middlebox, a certain type of data can be obtained from the middlebox, and compared with the method for calling the data from the middlebox storing all types of data, the method effectively reduces the problems of errors and the like when the data is called.
Referring to fig. 11, fig. 11 is a schematic structural diagram of a fourth task execution device according to an embodiment of the present disclosure, where the device includes the following modules 1101 and 1107.
A policy detection module 1101, configured to, in response to starting a task included in executing a service in a pipeline manner, if a preset detection condition is met, detect whether a target adjustment policy meeting a trigger time exists in adjustment policies bound in the pipeline manner, and if so, trigger a first policy execution module 1102, where the adjustment policy is: the strategy is used for adjusting the execution flow of the tasks included in the business;
the first policy executing module 1102 is configured to execute the target adjustment policy if an execution condition of the target adjustment policy is satisfied;
the modules 1101 and 1102 are the same as the modules 801 and 802 in the embodiment shown in FIG. 8.
An instruction receiving module 1105, configured to receive a start instruction for the problem processing service after the first policy execution module executes the target adjustment policy;
a second policy executing module 1106, configured to execute the configured problem handling policies according to the execution order of the problem handling policies configured by the problem handling service, so as to obtain a handling result;
a problem processing module 1107, configured to process a problem existing in an execution flow of a task included in the execution of the service based on the processing result;
a flow adjusting module 1103, configured to adjust an execution flow of a task included in the service based on an execution result of the target adjustment policy;
and a task execution module 1104, configured to execute a task included in the service according to the adjusted execution flow.
The above blocks 1103-1104 are the same as the blocks 803-804 in the embodiment shown in FIG. 8.
As can be seen from the above, after receiving a start instruction for the problem handling service, the problem handling policies are executed according to the execution order of the problem handling policies, and since the problem handling policies are policies for handling problems occurring during the task execution process, problems existing in the execution flow of tasks included in the execution service can be handled based on the processing result of executing the problem handling policies. Compared with the problem processing by manual operation, the problem processing efficiency is obviously improved.
In one embodiment of the present disclosure, the problem handling policy includes at least one of the following policies: the problem analysis strategy, the problem processing priority determination strategy, the problem marking strategy, the problem self-healing strategy, the problem issuing strategy and the problem reporting strategy.
The problem processing strategy comprises at least one of a problem analysis strategy, a problem processing priority determination strategy, a problem marking strategy, a problem self-healing strategy, a problem issuing strategy and a problem reporting strategy, so that the problem processing strategy is rich, and the obtained processing result is rich and comprehensive when the problem processing strategy is executed subsequently.
In an embodiment of the disclosure, the trigger timing includes at least one of the following timings: executing the process of the task included in the service before executing the first task included in the service, and after finishing the task included in the service.
The process of executing the task included in the service is executed before the first task included in the service is executed, the three trigger times cover the complete execution process of executing the task included in the service in a pipeline mode after the task included in the service is executed, and the target adjustment strategy meeting the trigger times is distributed in the complete execution process of executing the task included in the service, so that the execution flow of the task in the complete execution process can be adjusted based on the target adjustment strategy.
In an embodiment of the present disclosure, the adjustment policy includes at least one of the following policies: the task information analysis strategy, the task skipping strategy, the task ordering strategy, the task canceling strategy and the task execution result multiplexing strategy.
The adjustment strategy comprises at least one of a task information analysis strategy, a task skipping strategy, a task sequencing strategy, a task canceling strategy and a task execution result multiplexing strategy, so that the adjustment strategy is richer, and the obtained execution result is richer and comprehensive when the adjustment strategy is executed subsequently.
In the technical scheme of the disclosure, the collection, storage, use, processing, transmission, provision, disclosure and other processing of the personal information of the related user are all in accordance with the regulations of related laws and regulations and do not violate the good customs of the public order.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
An embodiment of the present disclosure provides an electronic device, where the electronic device includes:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the above task execution method.
The disclosed embodiments provide a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the above task execution method.
The disclosed embodiments provide a computer program product comprising a computer program that, when executed by a processor, implements the task execution method described above.
As can be seen from the above, in the solution provided in the embodiment of the present disclosure, the tasks included in the service are executed in a pipeline manner, and the adjustment policy is bound in the pipeline manner, so that when the tasks are executed, the target adjustment policy is detected and the target adjustment policy is conditionally executed in response to starting the execution of the tasks included in the service in the pipeline manner. Since the target adjustment policy is a policy for adjusting the execution flow of the task included in the service, the execution flow of the task can be adjusted based on the execution result of the target adjustment policy, and the task included in the service is executed according to the adjusted execution flow, so that the process of executing the task can be changed. Compared with the method for executing the task according to the fixed and unchangeable execution flow, the method for executing the task according to the embodiment of the disclosure changes the task execution process into the dynamic execution process, enriches the task execution flow, and improves the flexibility of task execution, thereby improving the efficiency of task execution.
FIG. 12 shows a schematic block diagram of an example electronic device 1200, which can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 12, the apparatus 1200 includes a computing unit 1201 which can perform various appropriate actions and processes in accordance with a computer program stored in a Read Only Memory (ROM)1202 or a computer program loaded from a storage unit 1208 into a Random Access Memory (RAM) 1203. In the RAM 1203, various programs and data required for the operation of the device 1200 may also be stored. The computing unit 1201, the ROM 1202, and the RAM 1203 are connected to each other by a bus 1204. An input/output (I/O) interface 1205 is also connected to bus 1204.
Various components in the device 1200 are connected to the I/O interface 1205 including: an input unit 1206 such as a keyboard, a mouse, or the like; an output unit 1207 such as various types of displays, speakers, and the like; a storage unit 1208, such as a magnetic disk, optical disk, or the like; and a communication unit 1209 such as a network card, modem, wireless communication transceiver, etc. The communication unit 1209 allows the device 1200 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The computing unit 1201 may be a variety of general purpose and/or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 1201 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The computing unit 1201 executes the respective methods and processes described above, such as the above-described task execution method. For example, in some embodiments, the task execution methods described above may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 1208. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 1200 via the ROM 1202 and/or the communication unit 1209. When the computer program is loaded into the RAM 1203 and executed by the computing unit 1201, one or more steps of the above-described task execution method described above may be performed. Alternatively, in other embodiments, the computing unit 1201 may be configured by any other suitable means (e.g., by means of firmware) to perform the task execution methods described above.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server with a combined blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (17)

1. A task execution method, comprising:
responding to the starting of tasks included in the execution of services in a pipeline mode, if a preset detection condition is met, detecting whether a target adjustment strategy meeting a trigger opportunity exists in adjustment strategies bound in the pipeline mode, wherein the adjustment strategies are as follows: the strategy is used for adjusting the execution flow of the tasks included in the business;
if so, executing the target adjustment strategy under the condition of meeting the execution condition of the target adjustment strategy;
adjusting the execution flow of the tasks included in the business based on the execution result of the target adjustment strategy;
and executing the tasks included in the service according to the adjusted execution flow.
2. The method of claim 1, further comprising:
responding to the task of executing the service in a pipeline mode, and obtaining a strategy link reflecting the dependency relationship between the bound adjustment strategies in the pipeline mode;
the executing the target adjustment strategy under the condition that the executing condition of the target adjustment strategy is met comprises the following steps:
determining a dependence strategy of a target adjustment strategy according to the strategy link;
and executing the target adjustment strategy under the condition that the execution of the dependent strategy is finished.
3. The method of claim 1, wherein the executing a target adjustment policy comprises:
calling the target adjustment strategy from a strategy intermediate station, and obtaining configuration data required by executing the target adjustment strategy from a data intermediate station, wherein the strategy intermediate station is used for storing the strategy, and the data intermediate station is used for storing the configuration data required by the strategy stored by the strategy intermediate station;
executing the target adjustment strategy based on the configuration data.
4. The method of any of claims 1-3, after the executing the target adjustment policy, the method further comprising:
receiving a starting instruction aiming at the problem processing service;
executing the configured problem processing strategies according to the execution sequence of the problem processing strategies configured by the problem processing service to obtain a processing result;
and processing problems existing in the execution flow of the tasks included in the business based on the processing result.
5. The method of claim 4, wherein the issue handling policy comprises at least one of: the problem analysis strategy, the problem processing priority determination strategy, the problem marking strategy, the problem self-healing strategy, the problem issuing strategy and the problem reporting strategy.
6. The method of any of claims 1-3, wherein the trigger occasion comprises at least one of:
before executing the first task included in the service, in the process of executing the task included in the service, after the task included in the service is finished.
7. The method according to any of claims 1-3, wherein the adjustment policy comprises at least one of the following policies:
the task information analysis strategy, the task skipping strategy, the task ordering strategy, the task canceling strategy and the task execution result multiplexing strategy.
8. A task execution device comprising:
a policy detection module, configured to respond to starting a task included in executing a service in a pipeline manner, if a preset detection condition is met, detect whether a target adjustment policy that meets a trigger time exists in adjustment policies bound in the pipeline manner, and if so, trigger a first policy execution module, where the adjustment policy is: the strategy is used for adjusting the execution flow of the tasks included in the business;
the first strategy execution module is used for executing the target adjustment strategy under the condition that the execution condition of the target adjustment strategy is met;
the flow adjusting module is used for adjusting the execution flow of the tasks included in the business based on the execution result of the target adjusting strategy;
and the task execution module is used for executing the tasks included in the service according to the adjusted execution flow.
9. The apparatus of claim 8, the apparatus further comprising:
a link obtaining module, configured to obtain a policy link reflecting a dependency relationship between adjustment policies that have been bound in a pipeline manner in response to starting a task included in executing a service in the pipeline manner;
the first policy enforcement module includes:
the strategy determining submodule is used for determining a dependence strategy of a target adjustment strategy according to the strategy link;
and the first strategy execution sub-module is used for executing the target adjustment strategy under the condition that the execution of the dependence strategy is finished.
10. The apparatus of claim 8, wherein the first policy enforcement module comprises:
the information calling submodule is used for calling the target adjustment strategy from a strategy console and obtaining configuration data required by executing the target adjustment strategy from a data console, wherein the strategy console is used for storing the strategy, and the data console is used for storing the configuration data required by the strategy stored by the strategy console;
and the second strategy execution sub-module is used for executing the target adjustment strategy based on the configuration data.
11. The apparatus of any one of claims 8-10, the apparatus further comprising:
the instruction receiving module is used for receiving a starting instruction aiming at the problem processing service after the first strategy execution module executes the target adjustment strategy;
the second strategy execution module is used for executing the configured problem processing strategies according to the execution sequence of the problem processing strategies configured by the problem processing service to obtain a processing result;
and the problem processing module is used for processing problems in the execution flow of the tasks included in the business based on the processing result.
12. The apparatus of claim 11, wherein,
the problem handling strategy comprises at least one of the following strategies: the problem analysis strategy, the problem processing priority determination strategy, the problem marking strategy, the problem self-healing strategy, the problem issuing strategy and the problem reporting strategy.
13. The apparatus of any one of claims 8-10,
the trigger occasions include at least one of the following occasions: before executing the first task included in the service, in the process of executing the task included in the service, after the task included in the service is finished.
14. The apparatus of any one of claims 8-10,
the adjustment strategy comprises at least one of the following strategies: the task information analysis strategy, the task skipping strategy, the task ordering strategy, the task canceling strategy and the task execution result multiplexing strategy.
15. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
16. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-7.
17. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-7.
CN202111249414.4A 2021-10-26 2021-10-26 Task execution method, device, equipment and storage medium Pending CN113986495A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111249414.4A CN113986495A (en) 2021-10-26 2021-10-26 Task execution method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111249414.4A CN113986495A (en) 2021-10-26 2021-10-26 Task execution method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113986495A true CN113986495A (en) 2022-01-28

Family

ID=79741802

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111249414.4A Pending CN113986495A (en) 2021-10-26 2021-10-26 Task execution method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113986495A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114518917A (en) * 2022-04-20 2022-05-20 浙江大华技术股份有限公司 Algorithm module scheduling method, algorithm module scheduling device and readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114518917A (en) * 2022-04-20 2022-05-20 浙江大华技术股份有限公司 Algorithm module scheduling method, algorithm module scheduling device and readable storage medium

Similar Documents

Publication Publication Date Title
CN107016480B (en) Task scheduling method, device and system
CN110738389A (en) Workflow processing method and device, computer equipment and storage medium
US11030002B2 (en) Optimizing simultaneous startup or modification of inter-dependent machines with specified priorities
US20160004566A1 (en) Execution time estimation device and execution time estimation method
US20200073639A1 (en) Automated process analysis and automation implementation
CN114430365A (en) Fault root cause analysis method and device, electronic equipment and storage medium
CN113986495A (en) Task execution method, device, equipment and storage medium
CN113568604A (en) Method and device for updating wind control strategy and computer readable storage medium
CN116860344A (en) Flow management method, system, equipment and medium
CN115115062B (en) Machine learning model building method, related device and computer program product
US20220365812A1 (en) Method and system for sustainability measurement
CN105868957A (en) Continuous integration method and device
CN115309558A (en) Resource scheduling management system, method, computer equipment and storage medium
CN113656239A (en) Monitoring method and device for middleware and computer program product
CN114615144B (en) Network optimization method and system
CN108694046B (en) Container assembly method and apparatus
CN117112498B (en) Application migration method, device, electronic equipment and storage medium
US20230401087A1 (en) Method and system for automated migration of high performance computing application to serverless platform
CN117971412A (en) Task dependency scheduling method supporting dependency arrangement
CN114968409A (en) Management method, device and equipment for complex dependency relationship of software service
CN117112224A (en) Method, device, equipment and medium for cross-architecture scheduling of container application
CN117632437A (en) Task scheduling method, device, equipment and storage medium
CN116954843A (en) Node scheduling method, node scheduling device, electronic equipment and computer program product
CN114968271A (en) Model deployment method and device, electronic equipment and storage medium
CN115526453A (en) Vehicle scheduling method, device, equipment, storage medium and computer program product

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