Task running method and equipment

The process task sequence is arranged through the process engine template, which solves the difficulty of orderly running of tasks between processes, simplifies process engine development, reduces the development difficulty, and improves the accuracy of task running and the data isolation effect.

CN112799646BActive Publication Date: 2024-09-06DOUYIN VISION CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202110182058.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-09
Publication Date
2024-09-06
Estimated Expiration
2041-02-09

AI Technical Summary

Technical Problem

In the existing technology, it is difficult to orderly run tasks between different processes, especially because it requires mastering professional containerization technologies such as docker and kubernetes, which makes the development of process engines and task orchestration operations more difficult.

Method used

The task running sequence corresponding to different processes is arranged through the process engine template. The process engine template is a simple configuration file. Developers can generate the process engine template according to the preset format to realize the development of the process engine without mastering docker and kubernetes technology to ensure The task running time periods of multiple process templates do not overlap.

Benefits of technology

It reduces the difficulty of developing the process engine and the difficulty of implementing the orderly operation of different process tasks, simplifies the development process of the process engine, and improves the accuracy of task operation and the effect of data isolation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112799646B
    Figure CN112799646B
Patent Text Reader

Abstract

The present disclosure provides a task running method and device, the method comprising: receiving a task running instruction, the task running instruction including an identifier of a process engine template; obtaining a process engine template according to the identifier, the process engine template including at least one process template; running the corresponding task according to the order of at least one process template in the process engine template, each process template corresponds to a task, when the process engine template includes multiple process templates, the running time periods of the tasks corresponding to any two process templates in the multiple process templates do not overlap. Since the process engine template is a simple configuration file, developers can generate the process engine template according to a preset format to realize the development of the process engine, and do not need to master docker and kubernetes technology. This can reduce the difficulty of developing the process engine, and further reduce the difficulty of implementing the orderly operation of tasks corresponding to different processes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular to a task execution method and device. Background Art

[0002] The process engine is a technology that runs tasks in a serial or concurrent manner for multiple processes. For example, in a software development platform, the launch process of a software product can be divided into the following processes: compilation and packaging, deployment of a test environment, small-volume launch, and full-volume launch. During a task run, the tasks of compilation and packaging, deployment of a test environment, small-volume launch, and full-volume launch can be run in series, that is, the tasks corresponding to each process are run sequentially during a task run. During multiple task runs, multiple runs can be parallel, but they are run in series during each task run. For example, for two task runs, during the first task run, the compilation and packaging task TK11, the deployment of a test environment task TK12, the small-volume launch task TK13, and the full-volume launch task TK14 are run in series; during the second task run, the compilation and packaging task TK21, the deployment of a test environment task TK22, the small-volume launch task TK23, and the full-volume launch task TK24 are run in series.

[0003] In the prior art, process engines are usually implemented through containerization technology to avoid task isolation and orchestration between processes.

[0004] However, the above solution makes it difficult to implement orderly execution of tasks between different processes. Summary of the invention

[0005] The embodiments of the present disclosure provide a task running method and device to solve the problem in the prior art that it is difficult to realize the orderly running of tasks between different processes.

[0006] In a first aspect, an embodiment of the present disclosure provides a task execution method, including:

[0007] Receive a task execution instruction, wherein the task execution instruction includes an identifier of a process engine template;

[0008] In response to the task execution instruction, acquiring the process engine template according to the identifier, wherein the process engine template includes at least one process template;

[0009] The corresponding tasks are run in the order of at least one process template in the process engine template, each process template corresponds to a task, and when the process engine template includes multiple process templates, the running time periods of the tasks corresponding to any two process templates among the multiple process templates do not overlap.

[0010] In a second aspect, an embodiment of the present disclosure provides a task execution device, including:

[0011] A task execution command receiving module, used for receiving a task execution instruction, wherein the task execution instruction includes an identifier of a process engine template;

[0012] A process engine template acquisition module, configured to respond to the task execution instruction and acquire the process engine template according to the identifier, wherein the process engine template includes at least one process template;

[0013] A task execution module is used to run corresponding tasks according to the order of at least one process template in the process engine template, each process template corresponds to a task, and when the process engine template includes multiple process templates, the running time periods of the tasks corresponding to any two process templates among the multiple process templates do not overlap.

[0014] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor and a memory;

[0015] The memory stores computer-executable instructions;

[0016] The at least one processor executes the computer-executable instructions stored in the memory, so that the electronic device implements the method as described in the first aspect.

[0017] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, a computing device implements the method described in the first aspect above.

[0018] In a fifth aspect, an embodiment of the present disclosure provides a computer program, wherein the computer program is used to implement the method described in the first aspect above.

[0019] The task running method and device provided in this embodiment can receive a task running instruction, which includes an identifier of a process engine template; in response to the task running instruction, obtain a process engine template according to the identifier, and the process engine template includes at least one process template; run the corresponding task according to the order of at least one process template in the process engine template, each process template corresponds to a task, and when the process engine template includes multiple process templates, the running time periods of the tasks corresponding to any two process templates in the multiple process templates do not overlap. Since the process engine template is a simple configuration file, developers can generate the process engine template in a preset format to realize the development of the process engine, and do not need to master docker and kubernetes technology. Therefore, the present disclosure can reduce the difficulty of developing the process engine, and thus reduce the difficulty of implementing the orderly operation of tasks corresponding to different processes. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0021] Figure 1 A schematic diagram exemplarily shows a task running scenario applied in an embodiment of the present disclosure;

[0022] Figure 2 The following is a flowchart showing a method for executing a task according to an embodiment of the present disclosure;

[0023] Figure 3 The detailed process diagram of running a process engine template is exemplarily shown;

[0024] Figure 4 An exemplary diagram of a process of running a process engine template three times is shown;

[0025] Figure 5 The following is a schematic diagram showing the relationship between the task execution interface and the three categories;

[0026] Figure 6 The structure block diagram of a task running device provided by an embodiment of the present disclosure is exemplarily shown;

[0027] Figure 7 The structural block diagram of an electronic device provided by an embodiment of the present disclosure is exemplarily shown. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0029] The disclosed embodiments can be applied to task running scenarios of electronic devices. When there are multiple processes, these processes can be run in series or in parallel. These processes can be called tasks after running. One process can correspond to multiple tasks at the same time. The input and output of each task are different, but the processing logic is the same.

[0030] Figure 1 A schematic diagram exemplarily shows a task running scenario applied in an embodiment of the present disclosure. Figure 1 There are two processes TP1 and TP2. TP2 depends on TP1. Running TP1 and TP2 sequentially can achieve a total task. Figure 1 The process of sequentially executing two tasks for TP1 and TP2 is shown in FIG. 1 . The two tasks for process TP1 are executed twice to obtain two tasks TK1 and TK2 respectively. The two tasks for process TP2 are executed twice to obtain two tasks TK1 and TK2 respectively.

[0031] Among them, the inputs of TK1 and TK2 are IP1 and IP2 respectively. Since IP1 and IP2 are different, the outputs of TK1 and TK2 are also different, namely OP1 and OP2. Similarly, TP2 corresponds to two tasks TK3 and TK4. The inputs of TK3 and TK4 are IP3 and IP4 respectively. Since IP3 and IP4 are different, the outputs of TK3 and TK4 are also different, namely OP3 and OP4.

[0032] It should be noted that, since TP2 depends on TP1, running TK3 after running TK1 realizes the running of a total task, and running TK4 after running TK2 realizes the running of another total task. When the dependency relationship is that the input of the latter task is the output of the task it depends on, the output OP1 of TK1 can be used as the input IP3 of TK3, and the output OP2 of TK2 can be used as the input IP4 of TK4.

[0033] The electronic device mentioned above may be any device with data processing function, such as a computer.

[0034] In the above task running scenarios, the process engine can be implemented through containerization technologies such as Docker and Kubernetes to arrange the running order of tasks between different processes so that the tasks corresponding to different processes can run in sequence.

[0035] However, the above-mentioned Docker and Kubernetes are relatively professional technologies, and developers need to have a certain degree of mastery of Docker and Kubernetes. Since it is difficult to master containerization technologies such as Docker and Kubernetes, it is difficult to develop process engines, which in turn makes it difficult to implement the orderly operation of different processes.

[0036] In order to solve the above problems, the embodiments of the present disclosure can arrange the running order of tasks corresponding to different processes through a process engine template. Among them, the process engine template includes one or more process templates, a process template includes relevant information of a process, and the order of the process templates in the process engine template reflects the running order of tasks corresponding to the process templates. Since the process engine template is a simple configuration file, developers can generate the process engine template according to the preset format to realize the development of the process engine, and do not need to master docker and kubernetes technology. Therefore, the present disclosure can reduce the difficulty of developing the process engine, and then reduce the difficulty of realizing the orderly operation of tasks corresponding to different processes.

[0037] The following specific embodiments are used to describe in detail the technical solutions of the embodiments of the present disclosure and how the technical solutions of the present disclosure solve the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present disclosure will be described below in conjunction with the accompanying drawings.

[0038] Figure 2 A flowchart of a task execution method provided by an embodiment of the present disclosure is shown as an example. Figure 2 , the method comprising:

[0039] S101: Receive a task execution instruction, where the task execution instruction includes an identifier of a process engine template.

[0040] Among them, the task running instruction can be Figure 3 The process engine template can be triggered by a visual interface or an API (application programming interface). Thus, the identifier of the process engine template can be specified in the interface or API.

[0041] S102: In response to the task execution instruction, the process engine template is obtained according to the identifier, where the process engine template includes at least one process template.

[0042] The process engine template is a configuration file, for example, a configuration file in JSON (JavaScript Object Notation) format. The key-value pairs in the process engine template conform to the JSON format, and the key-value pairs include the name of the attribute and the data corresponding to the attribute. For example, the key-value pair "status": "run" can indicate that the attribute is a status, and the value is running, that is, the status is running.

[0043] It can be understood that the embodiment of the present disclosure does not limit the format of the configuration file.

[0044] The process templates in the process engine template are determined according to the role of the process engine template. After running the tasks corresponding to all the process templates in the process engine template, a total task can be achieved. For example, when the launch process of a software product is a total process, a process engine template can be set for the launch process, which includes the process templates corresponding to the following four processes: compilation and packaging, deployment of the test environment, small-volume launch, and full launch. Therefore, running the tasks corresponding to each process in the process engine template can achieve the launch task of the software product.

[0045] One process template in the process engine template corresponds to a process. The process template includes properties required for running the task corresponding to the process. The properties may include but are not limited to: input, output, type and status.

[0046] Among them, input is used to represent the data information input into the task, and output is used to represent the data information output from the task.

[0047] The status is used to indicate the running status of a task, including but not limited to: not running, running, running successfully, and running failed. Before running a task, the task status is not running; after starting the task, the task status is running; after the task runs successfully, the task status is running successfully; after the task fails, the task status is running failed.

[0048] It should be noted that when running a task according to a process engine template, the status in the process engine template is not modified, and the status in the process engine template can be a default value, for example, not running. When running a task corresponding to a process in a process engine template, the process engine template can be copied to obtain a task engine, that is, each process template in the process engine template is copied as a task, and the status in the task can be modified. In this way, for multiple task engines corresponding to the same process engine template, the status of tasks in different task engines corresponding to the same process can be distinguished.

[0049] The type is used to indicate the processing logic type of the task for the input, and is used to distinguish different processing processes. Usually, the input and output of different types of tasks are also different. For example, the type includes at least one of the following: the type for processing hypertext transfer protocol requests, the type for processing service creation requests, and the type for processing message processing requests, that is, the type can indicate that the task is used to process HTTP (hyper text transfer protocol, hypertext transfer protocol) requests, or service creation requests, or message processing requests.

[0050] It is understandable that the above types are usually determined in the process template. When the process template is copied to obtain the task engine, the type of the task in the task engine is the same as the type of the process template.

[0051] S103: Run corresponding tasks according to the order of at least one process template in the process engine template, each process template corresponds to one task. When the process engine template includes multiple process templates, the running time periods of the tasks corresponding to any two process templates among the multiple process templates do not overlap.

[0052] It can be understood that S101 to S103 are the process of running a task corresponding to a process template in a process engine template (hereinafter referred to as running a process engine template once). When the process engine template is run once, each process template in the process engine template corresponds to a task.

[0053] During one operation of the process engine template, the tasks corresponding to the process templates are run one by one in the above order. Specifically, the task corresponding to the first process template is started, and after each task corresponding to the process template is successfully run, the task corresponding to the next process template is run, until the task corresponding to the last process template is successfully run. In this way, during one operation, the confusion of data generated by different tasks during the operation can be avoided, and the data isolation between different tasks in the same operation process is achieved, which helps to improve the accuracy of the operation results.

[0054] It is understandable that the above S101 to S103 can be executed N times, that is, a process engine template is run N times. When the process engine template is run N times, each process template in the process engine template corresponds to N tasks respectively. During the N times of running the above process engine template, data isolation between the N times of running is also required.

[0055] Optionally, in order to achieve data isolation between N runs, the above-mentioned running of corresponding tasks according to the order of at least one process template in the process engine template may include: copying the above-mentioned process engine template to obtain the corresponding task engine, which includes the tasks corresponding to the above-mentioned process template; allocating free memory space to the task engine; and in the memory space, running at least one task in the task engine according to the order of tasks in the task engine.

[0056] Among them, in one operation of the process engine template, the process template corresponds to a task engine, the number of tasks included in the process engine template is the same as the number of process templates included in the process engine template, and each process template corresponds to a process, and each process corresponds to a task.

[0057] It is understandable that, in the memory space, according to the order of tasks in the task engine, at least one task in the task engine can use the resources of the memory space for all tasks in the task engine during operation.

[0058] Figure 3 The detailed flow diagram of running a process engine template is shown as an example. Figure 3 As shown, first, the visual interface or API sends a task running instruction to the process management class, that is, the process management class receives the task running instruction through S101, and the task running instruction includes an identifier of a process engine template; then, the process management class sends a process engine template acquisition instruction to the storage device, and the process engine template acquisition instruction includes the identifier of the process engine template; the storage device returns the process engine template to the process management class, that is, the process management class obtains the process engine template through S102; then, the process management class generates and runs the task engine, and in the process of running the task engine, calls the task running interface to run the tasks included in the task engine in sequence; of course, the task running interface will record the running result in the task engine after running a task, and after running all tasks in the task engine, the task engine records the running results of all tasks, that is, the total task running result, and the process management class can obtain the total task running result from the task engine; finally, on the one hand, the process management class returns the total task running result to the visual interface or API as a response, and on the other hand, the process management class can also write the total task running result into a log file and obtain the write result.

[0059] In the disclosed embodiment, for each operation of the process engine template, an idle memory space is allocated to the task engine corresponding to the process engine template, so that the data generated by the tasks in the task engine during the operation process are stored in the memory space. Since the idle memory space includes the data that has not been allocated to the started task engine before, the memory spaces of different task engines are different, and the data generated by the tasks in different task engines during the operation process will not be confused, thereby achieving data isolation between different task engines.

[0060] Figure 4 The schematic diagram of the process of running a process engine template three times is shown as an example. Figure 4 As shown, three runs generate task engines TKE1, TKE2 and TKE3, corresponding to the first run, the second run and the third run respectively, and each task engine runs in a separate memory space, thus achieving data isolation between TKE1, TKE2 and TKE3.

[0061] Above Figure 4 In the example, since the three runs correspond to the same process engine template, TKE1, TKE2 and TKE3 all include the same number of tasks, and there is a corresponding relationship between the tasks, that is, task TK11 in TKE1, task TK21 in TKE2 and task TK31 in TKE3 all correspond to the first process template in the process engine template, and task TK12 in TKE1, task TK22 in TKE2 and task TK32 in TKE3 all correspond to the second process template in the process engine template. Template, task TK13 in TKE1, task TK23 in TKE2 and task TK33 in TKE3 all correspond to the third process template in the process engine template, task TK14 in TKE1, task TK24 in TKE2 and task TK34 in TKE3 all correspond to the fourth process template in the process engine template, task TK15 in TKE1, task TK25 in TKE2 and task TK35 in TKE3 all correspond to the fifth process template in the process engine template.

[0062] In addition, in TKE1, the above tasks in TKE1 are executed in the order of TK11, TK12, TK13, TK14 and TK15. In TKE2, the above tasks in TKE2 are executed in the order of TK21, TK22, TK23, TK24 and TK25. In TKE3, the above tasks in TKE3 are executed in the order of TK31, TK32, TK33, TK34 and TK35. Figure 4The tasks in bold are unrunning tasks. At the current time, the unrunning tasks in TKE1 include TK15, the unrunning tasks in TKE2 include TK24 and TK25, and the unrunning tasks in TKE3 include TK33, TK34, and TK35. It can be seen that the unrunning tasks in the first run are less than the unrunning tasks in the second run, and the unrunning tasks in the second run are less than the unrunning tasks in the third run, so the start time of the first run is earlier than the start time of the second run, and the start time of the second run is earlier than the start time of the third run.

[0063] Of course, in actual applications, the start time of different runs can be the same, so that at the same time, the unrunning tasks in the task engine corresponding to different runs correspond to the same process template in the process engine template, that is, different runs are performed synchronously.

[0064] All tasks in the task engine use the resources of the memory space during operation, and data generated by all tasks in the task engine during operation can be used in the memory space. Thus, in the memory space, at least one task in the task engine, according to the task order in the task engine, includes: before running one of the tasks according to the task order in the task engine, allocating a free subspace in the corresponding memory space to the task; running the task, and storing the data generated during the running of the task in the memory space.

[0065] The data generated during the execution of the task include: variables defined during the execution of the task, required classes, inputs and outputs, etc.

[0066] It can be seen that in order to achieve data isolation between tasks as much as possible, the embodiment of the present disclosure allocates different subspaces to each task. After the task is completed, the subspace occupied by the task can be released.

[0067] Optionally, before running one of the first tasks in the task order in the above-mentioned task engine, obtain the second attribute of the second task on which the first attribute depends based on the target symbol included in the first attribute of the first task, and the above-mentioned second task is located before the first task in the task engine; determine the data corresponding to the first attribute based on the data corresponding to the second attribute; and run the first task through the data of the first attribute.

[0068] The first task and the second task are two tasks in the task engine, and the first task depends on the second task, the second task runs before the first task, and the process template corresponding to the second task is located before the process template corresponding to the first task in the process engine template. The first task depends on the second task, that is, at least one first attribute of the first task depends on at least one second attribute of the second task.

[0069] Based on the above dependency, the first attribute includes information for specifying the second task and the second attribute, which can be indicated by the target symbol. Specifically, the identifier of the second task and the identifier of the second attribute can be located before, after, or between the target symbol. The data corresponding to the second attribute can be all or part of the data corresponding to the first attribute.

[0070] Optionally, the target symbol includes a start sub-symbol and an end sub-symbol, and the information between the start sub-symbol and the end sub-symbol includes an identifier of the second task and an identifier of the second attribute.

[0071] The starting sub-symbol and the ending sub-symbol may include one or more. For example, the starting sub-symbol may be "${{", and the ending sub-symbol may be "}}", so that TK[1].output in "${{TK[1].output}}" includes the identifier of the second task and the identifier of the second attribute. The identifier of the second task may be 1, and the identifier of the second attribute may be output, that is, the output of the task with the identifier 1 is the data corresponding to the attribute of the first task. When the attribute is input, the identifier of the first task is 2, and the identifier of the task represents the position number of the task in the task engine, the above "${{TK[1].output}}" represents the output of the first task in the task engine as the input of the second task.

[0072] The embodiment of the present disclosure can accurately determine the identifier of the second task and the identifier of the second attribute through the start sub-symbol and the end sub-symbol, so as to make the dependency relationship between tasks more accurate.

[0073] Optionally, before the first task is executed according to the data of the first attribute, a free subspace in the memory space may be allocated to the first task, and data generated during the execution of the first task may be stored in the memory space.

[0074] Optionally, when running one of the tasks according to the task sequence in the task engine, the type of the task is used as the input of the task running interface, and the task running class corresponding to the type is called through the task running interface to run the task.

[0075] The task running interface can be used as a unified interface corresponding to multiple types of task running classes, and the interface can call the corresponding task running class by type. For example, Figure 5 The following is an example of the relationship between the task execution interface and the three types. Figure 5As shown, when the type indicates that the task is used to process HTTP requests, the interface can call the HTTP request processing class to process the HTTP request; when the type indicates that the task is used to process service creation requests, the interface can call the service creation class to create a service; when the type indicates that the task is used to process messages, the interface can call the message processing class to send, receive, and other processes the messages.

[0076] Table 1 exemplifies the above three types of input, processing and output.

[0077]

[0078] Table 1

[0079] Optionally, running the first task according to the data of the first attribute may include: taking the type of the first task as an input of a task running interface, and calling a task running class corresponding to the type through the task running interface to run the first task according to the data of the first attribute.

[0080] Corresponding to the task running method of the above embodiment, Figure 6 The following is an exemplary structural block diagram of a task execution device provided by an embodiment of the present disclosure. For the sake of convenience, only the parts related to the embodiment of the present disclosure are shown. Figure 6 The task running device 200 includes: a task running command receiving module 201, a process engine template obtaining module 202 and a task execution module 203.

[0081] The task execution command receiving module 201 is used to receive a task execution instruction, wherein the task execution instruction includes an identifier of a process engine template.

[0082] The process engine template acquisition module 202 is used to respond to the task running instruction and acquire the process engine template according to the identifier, wherein the process engine template includes at least one process template.

[0083] The task execution module 203 is used to run the corresponding tasks according to the order of the at least one process template in the process engine template, each process template corresponds to a task, and when the process engine template includes multiple process templates, the running time periods of the tasks corresponding to any two process templates among the multiple process templates do not overlap.

[0084] Optionally, the task execution module 203 is also used to: copy the process engine template to obtain a corresponding task engine, wherein the task engine includes tasks corresponding to the process template; allocate free memory space to the task engine; and run at least one task in the task engine in the memory space according to the task order in the task engine.

[0085] Optionally, the task execution module 203 is also used to: before running one of the tasks in the task order in the task engine, allocate a free subspace in the memory space to the task; run the task, and store data generated during the running of the task in the memory space.

[0086] Optionally, the task execution module 203 is also used for: before running one of the first tasks according to the task order in the task engine, obtaining the second attribute of the second task on which the first attribute depends according to the target symbol included in the first attribute in the first task, wherein the second task is located before the first task in the task engine; determining the data corresponding to the first attribute according to the data corresponding to the second attribute; and running the first task according to the data of the first attribute.

[0087] Optionally, the target symbol includes a start sub-symbol and an end sub-symbol, and the information between the start sub-symbol and the end sub-symbol includes an identifier of the second task and an identifier of the second attribute.

[0088] Optionally, the task execution module 203 is also used to: when running one of the tasks according to the task sequence in the task engine, use the type of the task as the input of the task running interface, and call the task running class corresponding to the type through the task running interface to run the task.

[0089] Optionally, the attributes of the task include at least one of the following: input, output, type and status, the status is one of the following: not running, running, successful running, failed running, and the type is used to represent the processing logic type of the task on the input.

[0090] Optionally, the type includes at least one of the following: a type for processing a hypertext transfer protocol request, a type for processing a service creation request, and a type for processing a message processing request.

[0091] The task execution device provided in this embodiment can be used to execute the above Figure 2 The technical solution of the method embodiment shown has similar implementation principles and technical effects, and will not be repeated here in this embodiment.

[0092] Figure 7 The structural block diagram of an electronic device provided by an embodiment of the present disclosure is exemplarily shown. The electronic device 600 includes a memory 602 and at least one processor 601;

[0093] The memory 602 stores computer-executable instructions;

[0094] At least one processor 601 executes the computer execution instructions stored in the memory 602, so that the electronic device implements the aforementioned Figure 2 Methods in

[0095] In addition, the electronic device 600 may further include a receiver 603 and a transmitter 604. The receiver 603 is used to receive information from other devices or equipment and forward it to the processor 601. The transmitter 604 is used to send the information to other devices or equipment.

[0096] The present disclosure also provides a computer program for implementing the above Figure 2 The method in .

[0097] The embodiment of the present disclosure also provides a computer-readable storage medium, in which a computer-executable instruction is stored. When a processor executes the computer-executable instruction, a computing device is enabled to implement the above-mentioned Figure 2 The method in .

[0098] In a first example of the first aspect, an embodiment of the present disclosure provides a task running method, including:

[0099] receiving a task execution instruction, wherein the task execution instruction includes an identifier of a process engine template;

[0100] In response to the task execution instruction, acquiring the process engine template according to the identifier, wherein the process engine template includes at least one process template;

[0101] The corresponding tasks are run in the order of at least one process template in the process engine template, each process template corresponds to a task, and when the process engine template includes multiple process templates, the running time periods of the tasks corresponding to any two process templates among the multiple process templates do not overlap.

[0102] Based on the first example of the first aspect, in a second example of the first aspect, running corresponding tasks according to the order of the at least one process template in the process engine template includes:

[0103] Copying the process engine template to obtain a corresponding task engine, wherein the task engine includes tasks corresponding to the process template;

[0104] Allocating free memory space to the task engine;

[0105] In the memory space, at least one task in the task engine is executed according to the order of tasks in the task engine.

[0106] Based on the second example of the first aspect, in a third example of the first aspect, running at least one task in the task engine in the memory space according to the task order in the task engine includes:

[0107] Before running one of the tasks according to the task order in the task engine, allocating a free subspace in the memory space to the task;

[0108] The task is run, and data generated during the running of the task is stored in the memory space.

[0109] Based on the second example of the first aspect, in a fourth example of the first aspect, running at least one task in the task engine according to the task order in the task engine includes:

[0110] Before running one of the first tasks according to the task order in the task engine, obtaining a second attribute of a second task on which the first attribute depends according to a target symbol included in a first attribute in the first task, wherein the second task is located before the first task in the task engine;

[0111] Determine the data corresponding to the first attribute according to the data corresponding to the second attribute;

[0112] The first task is executed according to the data of the first attribute.

[0113] Based on the fourth example of the first aspect, in the fifth example of the first aspect, the target symbol includes a starting sub-symbol and an ending sub-symbol, and the information between the starting sub-symbol and the ending sub-symbol includes an identifier of the second task and an identifier of the second attribute.

[0114] Based on the second example of the first aspect, in a sixth example of the first aspect, running at least one task in the task engine according to the task order in the task engine includes:

[0115] When one of the tasks is run according to the task sequence in the task engine, the type of the task is used as an input of a task running interface, and a task running class corresponding to the type is called through the task running interface to run the task.

[0116] Based on any one of the first to sixth examples of the first aspect, in the seventh example of the first aspect, the attributes of the task include at least one of the following: input, output, type and status, the status is one of the following: not running, running, successful operation, failed operation, and the type is used to represent the processing logic type of the task on the input.

[0117] Based on the seventh example of the first aspect, in the eighth example of the first aspect, the type includes at least one of the following: a type for processing Hypertext Transfer Protocol requests, a type for processing service creation requests, and a type for processing message processing requests.

[0118] In a first example of the second aspect, a task running device is provided, including:

[0119] A task execution command receiving module, used for receiving a task execution instruction, wherein the task execution instruction includes an identifier of a process engine template;

[0120] A process engine template acquisition module, configured to respond to the task execution instruction and acquire the process engine template according to the identifier, wherein the process engine template includes at least one process template;

[0121] A task execution module is used to run corresponding tasks according to the order of at least one process template in the process engine template, each process template corresponds to a task, and when the process engine template includes multiple process templates, the running time periods of the tasks corresponding to any two process templates among the multiple process templates do not overlap.

[0122] Based on the first example of the second aspect, in the second example of the second aspect, the task execution module is also used to: copy the process engine template to obtain a corresponding task engine, wherein the task engine includes tasks corresponding to the process template; allocate free memory space to the task engine; and in the memory space, run at least one task in the task engine according to the task order in the task engine.

[0123] Based on the second example of the second aspect, in the third example of the second aspect, the task execution module is also used to: allocate a free subspace in the memory space to the task before running one of the tasks in the task order in the task engine; run the task, and store the data generated during the running of the task in the memory space.

[0124] Based on the second example of the second aspect, in the fourth example of the second aspect, the task execution module is also used to: before running one of the first tasks according to the task order in the task engine, obtain the second attribute of the second task on which the first attribute depends according to the target symbol included in the first attribute of the first task, and the above-mentioned second task is located before the first task in the task engine; determine the data corresponding to the first attribute according to the data corresponding to the second attribute; and run the first task according to the data of the first attribute.

[0125] Based on the fourth example of the second aspect, in the fifth example of the second aspect, the target symbol includes a starting sub-symbol and an ending sub-symbol, and the information between the starting sub-symbol and the ending sub-symbol includes an identifier of the second task and an identifier of the second attribute.

[0126] Based on the second example of the second aspect, in the sixth example of the second aspect, the task execution module is also used to: when running one of the tasks according to the task order in the task engine, use the type of the task as the input of the task running interface, and call the task running class corresponding to the type through the task running interface to run the task.

[0127] Based on any one of the first to sixth examples of the second aspect, in the seventh example of the second aspect, the attributes of the task include at least one of the following: input, output, type and status, the status is one of the following: not running, running, successful operation, failed operation, and the type is used to represent the processing logic type of the task on the input.

[0128] Based on the seventh example of the second aspect, in the eighth example of the second aspect, the type includes at least one of the following: a type for processing Hypertext Transfer Protocol requests, a type for processing service creation requests, and a type for processing message processing requests.

[0129] In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: at least one processor and a memory;

[0130] The memory stores computer-executable instructions;

[0131] The at least one processor executes the computer-executable instructions stored in the memory, so that the electronic device implements the method described in the first aspect above.

[0132] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer execution instructions, and when a processor executes the computer execution instructions, a computing device implements the method described in the first aspect above.

[0133] In a fifth aspect, according to one or more embodiments of the present disclosure, a computer program is provided, wherein the computer program is used to implement the method described in the first aspect above.

[0134] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0135] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0136] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A task running method, characterized in that: include: Receive a task execution instruction, wherein the task execution instruction includes an identifier of a process engine template; In response to the task execution instruction, the process engine template is acquired according to the identifier, wherein the process engine template includes at least one process template, and the process engine template is a configuration file; According to the order of the at least one process template in the process engine template, the corresponding task is run, each process template corresponds to one task, and when the process engine template includes multiple process templates, the running time periods of the tasks corresponding to any two process templates do not overlap; The process template includes attributes of the corresponding task, and the attributes of the task include a status, and the status is one of the following: not running, running, running successfully, and running failed.

2. The method according to claim 1, characterized in that The running of corresponding tasks according to the order of the at least one process template in the process engine template includes: Copying the process engine template to obtain a corresponding task engine, wherein the task engine includes tasks corresponding to each of the process templates; Allocating free memory space to the task engine; In the memory space, at least one task in the task engine is executed according to the order of tasks in the task engine.

3. The method according to claim 2, characterized in that The step of running at least one task in the task engine in the memory space according to the task order in the task engine includes: Before running one of the tasks according to the task order in the task engine, allocating a free subspace in the memory space to the task; The task is run, and data generated during the running of the task is stored in the memory space.

4. The method according to claim 2, characterized in that The step of running at least one task in the task engine according to the task order in the task engine includes: Before running one of the first tasks in the task order in the task engine, obtaining a second attribute of a second task on which the first attribute depends according to a target symbol included in a first attribute in the first task, wherein the second task is located before the first task in the task engine; Determine the data corresponding to the first attribute according to the data corresponding to the second attribute; The first task is executed according to the data of the first attribute.

5. The method according to claim 4, characterized in that The target symbol includes a start sub-symbol and an end sub-symbol, and the information between the start sub-symbol and the end sub-symbol includes an identifier of the second task and an identifier of the second attribute.

6. The method according to claim 2, characterized in that The step of running at least one task in the task engine according to the task order in the task engine includes: When one of the tasks is run according to the task sequence in the task engine, the type of the task is used as an input of a task running interface, and a task running class corresponding to the type is called through the task running interface to run the task.

7. The method according to any one of claims 1 to 6, characterized in that: The attributes of the task further include at least one of the following: input, output, and type, where the type is used to represent the processing logic type of the task on the input.

8. The method according to claim 7, characterized in that The type includes at least one of the following: a type for processing a hypertext transfer protocol request, a type for processing a service creation request, and a type for processing a message processing request.

9. A task running device, characterized in that: include: A task execution command receiving module, used for receiving a task execution instruction, wherein the task execution instruction includes an identifier of a process engine template; A process engine template acquisition module, used to respond to the task running instruction and acquire the process engine template according to the identifier, wherein the process engine template includes at least one process template, and the process engine template is a configuration file; A task execution module, used to run the corresponding tasks according to the order of the at least one process template in the process engine template, each process template corresponds to one task, and when the process engine template includes multiple process templates, the running time periods of the tasks corresponding to any two process templates in the multiple process templates do not overlap; The process template includes attributes of the corresponding task, and the attributes of the task include a status, and the status is one of the following: not running, running, running successfully, and running failed.

10. An electronic device, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the electronic device implements the method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the computing device implements the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method for generating data processing flow codes

    CN102033748A

  • Task execution method, device and equipment and computer readable storage medium

    CN109725993A

  • Task execution method and system, and computer readable storage medium

    CN111506309A

  • Workflow management platform and workflow management system

    CN112068936A

  • Business process processing method and device and computer readable storage medium

    CN112099768A