Method, apparatus, electronic device, and computer program product for performing tasks

By receiving trigger instructions and obtaining task identifiers, we can determine whether there is a task identifier in the task trigger information, which solves the logical closed-loop problem when automatically triggering tasks, and improves the stability of automatic triggering tasks.

CN114237877BActive Publication Date: 2025-07-25BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111474512.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-03
Publication Date
2025-07-25
Estimated Expiration
2041-12-03

AI Technical Summary

Technical Problem

The prior art is prone to forming a logical closed loop when automatically triggering tasks, resulting in infinite loop execution of the system and even crashing.

Method used

By receiving the triggering command and obtaining the task identification, it is determined whether the task identification exists in the task triggering information. If it exists, the task identification will be stopped. If it does not exist, the task identification will be recorded and the task will be executed. The task trigger information will be established to record the identity of the executed task and avoid repeated execution.

Benefits of technology

It effectively avoids logical closed loops, improves the stability of automatically triggered tasks, and ensures the normal operation of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114237877B_ABST
    Figure CN114237877B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method, apparatus, electronic device, and computer program product for performing a task. Among them, the method for performing the task includes: receiving a first trigger instruction, determining a first trigger task corresponding to the first trigger instruction, obtaining a first task identifier corresponding to the first trigger task, and stopping the execution of the first trigger task when the first task identifier exists in the task trigger information. The present disclosure at least solves the problem in the prior art that it is impossible to break out of the logical closed loop when automatically triggering a task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of Internet technologies, and in particular, to a method, an apparatus, an electronic device, and a computer program product for executing tasks. Background Art

[0002] In the process of daily office work, users need to frequently create tasks, edit tasks, etc. every day. Among them, when creating a task, many fields need to be filled in, such as the person in charge, priority, and problem description. Moreover, when editing a task, the above fields also need to be modified. Therefore, there is too much repetitive work.

[0003] To solve the above problems, the prior art can create trigger tasks by using trigger technology. Among them, trigger technology is a configuration technology for system automated operation rules. Through trigger technology, users can customize automated operation rules and trigger tasks in the system. After the trigger condition is met, the system will automatically start the trigger task according to the automated operation rules and execute the operations corresponding to the trigger task, thereby reducing the manual repetitive workload.

[0004] However, when more and more trigger tasks are established, a situation where a logical loop may be formed between multiple trigger tasks may occur, resulting in the system entering a state of infinitely loop-executing trigger tasks, and even causing the system to crash. Summary of the Invention

[0005] The present disclosure provides a method, an apparatus, an electronic device, and a computer program product for executing tasks to at least solve the problem that the prior art cannot break out of the logical loop when automatically triggering tasks. The technical solution of the present disclosure is as follows:

[0006] According to a first aspect of an embodiment of the present disclosure, there is provided a method for executing a task, including: receiving a first trigger instruction, determining a first trigger task corresponding to the first trigger instruction, obtaining a first task identifier corresponding to the first trigger task, and thus stopping the execution of the first trigger task when the first task identifier exists in the task trigger information, where the task corresponding to the task identifier stored in the task trigger information is used to directly or indirectly trigger the execution of the first trigger task.

[0007] Further, the method for executing a task further includes: when the first task identifier does not exist in the task trigger information, recording the first task identifier in the task trigger information and executing the first trigger task.

[0008] Further, the method for executing a task further includes: obtaining a first execution result of executing a first trigger task; if the first execution result generates a second trigger instruction, determining a second trigger task corresponding to the second trigger instruction, thereby obtaining a second task identifier corresponding to the second trigger task, and further, when the second task identifier does not exist in the task trigger information, recording the second task identifier in the task trigger information, as well as the trigger relationship between the second task identifier and the first task identifier.

[0009] Further, the method for executing a task further includes: when the second task identifier does not exist in the task trigger information, executing the second trigger task to obtain a second execution result.

[0010] Further, the method for executing a task further includes: when the second task identifier exists in the task trigger information, stopping the execution of the second trigger task.

[0011] Further, the method for executing a task further includes: the task trigger information includes a plurality of subtask trigger information, and each subtask trigger information is at least used to record the task identifier of the corresponding trigger task.

[0012] According to a second aspect of the embodiments of the present disclosure, there is provided an apparatus for executing a task, including: a receiving unit configured to receive a first trigger instruction and determine a first trigger task corresponding to the first trigger instruction; an obtaining unit configured to obtain a first task identifier corresponding to the first trigger task; an execution unit configured to stop executing the first trigger task when the first task identifier exists in the task trigger information.

[0013] According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device, including: a processor; a memory for storing instructions executable by the processor; wherein, the processor is configured to execute the instructions to implement the above method for executing a task.

[0014] According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, when the instructions in the computer-readable storage medium are executed by a processor of a server, enabling the server to execute the above method for executing a task.

[0015] According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer program product, including computer programs / instructions, and when the computer programs / instructions are executed by a processor, implementing the above method for executing a task.

[0016] The technical solutions provided by the embodiments of the present disclosure at least bring the following beneficial effects:

[0017] Before the embodiment of the present disclosure executes the first trigger task, it first obtains the first task identifier corresponding to the first trigger task, records the task identifiers corresponding to the tasks that have been triggered through the task trigger information, and sets that if it is detected that the task trigger information contains the task identifier corresponding to the first trigger task, the execution of the first trigger task will be stopped. Therefore, when the first trigger task repeatedly enters the execution step, the electronic device will detect that the first task identifier already exists in the task trigger information, and thus stop executing the first trigger task again. It can be seen that the embodiment of the present disclosure achieves the purpose of avoiding the logical loop when automatically triggering tasks, solves the technical problem that the prior art cannot break out of the logical loop when automatically triggering tasks, and realizes the technical effect of improving the stability when automatically triggering tasks.

[0018] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and do not limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The accompanying drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure and do not constitute an improper limitation of the present disclosure.

[0020] Figure 1 is a flowchart of a method for executing a task shown according to an exemplary embodiment.

[0021] Figure 2 is a flowchart of a method for executing a task shown according to an exemplary embodiment.

[0022] Figure 3 is a block diagram of an apparatus for executing a task shown according to an exemplary embodiment.

[0023] Figure 4 is a block diagram of an electronic device shown according to an exemplary embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0024] In order to enable those of ordinary skill in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0025] It should be noted that the terms "first", "second", etc. in the description, claims and the above drawings of the present disclosure are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0026] It should be noted that an electronic device with a task execution function can be used as the execution subject of the task execution method in the embodiments of the present disclosure. Among them, the electronic device includes, but is not limited to: smart phones, servers, cloud servers, desktop computers, laptop computers, and smart tablets, etc.

[0027] In addition, it should also be noted that in the technical solution of the present disclosure, the acquisition, storage, application, etc. of the user's personal information all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.

[0028] Figure 1 is a flowchart of an image method shown according to an exemplary embodiment. As Figure 1 shown, the method for executing a task can be applied to an electronic device with a task execution function, and includes the following steps.

[0029] In step S11, a first trigger instruction is received, and a first trigger task corresponding to the first trigger instruction is determined.

[0030] Optionally, the first trigger instruction can be a manual trigger instruction input by the user, or an automatic trigger instruction generated by the electronic device according to the system automation operation rules. For example, when the time reaches a specific time such as 6:35 on July 21, 2021, a text message is sent to a specific user, and the content of the text message is a preset content. Or, when a text message is received by a specific user's mobile phone, an alarm clock is set for 20:19 on the same day. In addition, the electronic device can determine the corresponding first trigger task according to the received first trigger instruction. For example, the user can set the corresponding trigger rule between the first trigger instruction and the first trigger task in the electronic device. For example, the user sets a trigger in the system of the electronic device. When the priority field in the form is the highest priority, the system automatically modifies the corresponding person in charge in the form to "general manager". Among them, filling the priority field in the form as the highest priority is the first trigger instruction, and modifying the corresponding person in charge in the form to "general manager" is the first trigger task corresponding to the first trigger instruction.

[0031] It should be noted that in the above process, by establishing the rules between the first trigger instruction and the first trigger task, a large number of tasks that need to be processed manually can be automatically executed by the system in the electronic device, thus achieving the effect of saving time and improving work efficiency.

[0032] In step S12, obtain the first task identifier corresponding to the first trigger task.

[0033] Optionally, after the electronic device determines the first trigger task, it can obtain the first task identifier corresponding to the first trigger task. The first task identifier can be the number, name, etc. of the first trigger task. For example, a number "001" can be set for the first task identifier, and the name is "Task 1". Among them, the electronic device can automatically number and name new tasks in an incremental manner. For example, after the first trigger task, the user newly creates a trigger task, and the electronic device can automatically number it as "002" and name it "Task 2". In addition, the user can also determine the first task identifier manually.

[0034] It should be noted that through the above process, a corresponding first task identifier is set for the first trigger task. Thus, by obtaining the first task identifier, the electronic device can compare it with the task identifiers of the completed tasks stored in the task trigger information, and then determine whether to execute the first trigger task, so as to achieve the purpose of avoiding the logical loop when automatically triggering tasks.

[0035] In step S13, when the first task identifier exists in the task trigger information, stop executing the first trigger task.

[0036] Among them, the task trigger information can be represented in the form of a preset file. The tasks corresponding to the task identifiers already stored in the preset file are used to directly or indirectly trigger the execution of the first trigger task. Optionally, the first trigger task can be generated by a trigger. The preset file can be a trigger chain composed of multiple triggers. Task identifiers can be stored in the trigger chain. Among them, the tasks corresponding to the stored task identifiers can be used to directly trigger the first trigger task. For example, the task identifier is the first task identifier corresponding to the first trigger task; the tasks corresponding to the stored task identifiers can also be used to indirectly trigger the first trigger task. For example, the task identifier is the task identifier corresponding to the previous task of the first trigger task, but the first trigger task can only be triggered based on the completion of the previous task.

[0037] Furthermore, as Figure 2As shown, the first trigger task can be generated by trigger A. When the electronic device receives the first trigger instruction, trigger A is triggered. At the same time, the electronic device obtains the first task identifier corresponding to trigger A. When the electronic device detects the first task identifier corresponding to trigger A in the trigger chain, it stops triggering and executes the first trigger task. If the first task identifier corresponding to trigger A does not exist in the trigger chain, it executes the execution result of trigger A, that is, executes the first trigger task.

[0038] Optionally, when the first task identifier does not exist in the preset file, the electronic device can generate a first sub-file in the preset file, where the first sub-file is at least used to record the first task identifier. For example, as Figure 2 shown, when it is determined that trigger A is not in the entire trigger chain, while the electronic device executes the execution result of trigger A, it will generate a trigger chain "A", where the trigger chain "A" is the first sub-file. In addition, the preset file can be composed of multiple sub-files, and each sub-file is at least used to record the task identifier of the corresponding trigger task. For example, as Figure 2 shown, when it is determined that trigger B is not in the entire trigger chain, while the electronic device executes the execution result of trigger B, it will generate a trigger chain "A - B". When it is determined that trigger C is not in the entire trigger chain, while the electronic device executes the execution result of trigger C, it will generate a trigger chain "A - B - C". Among them, the trigger chain "A - B" is the second sub-file, the trigger chain "A - B - C" is the third sub-file, the entire trigger chain is the preset file, and the first sub-file, the second sub-file, and the third sub-file form the preset file.

[0039] In the above process, for the multiple task identifiers corresponding to multiple tasks, they can be recorded separately through multiple sub-files, and the preset file is composed of multiple sub-files. Thus, when there are multiple tasks and one trigger task is allowed to trigger another trigger task, according to the task identifiers recorded in multiple sub-files, when duplicate tasks enter, triggering and executing the tasks that have been executed can be stopped, thereby avoiding the problem of being unable to break out of the logical loop when automatically triggering multiple tasks, and thus achieving the effect of accurately and smoothly automatically triggering multiple tasks.

[0040] In addition, it should also be noted that if a triggering task cannot trigger another triggering task to avoid the occurrence of a logical loop, the application scenarios of the triggering task will be greatly reduced, thus violating the original intention of reducing the manual repetitive workload by establishing the triggering task. In the above process, the task identifier corresponding to the task that has been triggered is recorded through a preset file. When it is detected that the first task identifier corresponding to the first triggering task to be executed exists in the preset file, the first triggering task is stopped from being triggered. The entire process does not require setting a rule that a triggering task cannot trigger another triggering task, and can solve the technical problem that the prior art cannot break out of the logical loop when automatically triggering tasks, achieving the technical effect of improving the stability when automatically triggering tasks.

[0041] Based on the process from step S11 to step S13, it can be seen that in the embodiment of the present disclosure, a method is adopted in which whether to execute the first triggering task is determined according to whether there is a task identifier corresponding to the first triggering task in the task triggering information. By receiving the first triggering instruction, determining the first triggering task corresponding to the first triggering instruction, and obtaining the first task identifier corresponding to the first triggering task, when there is a first task identifier in the task triggering information, the execution of the first triggering task is stopped, where the task corresponding to the task identifier stored in the task triggering information is used to directly or indirectly trigger the execution of the first triggering task.

[0042] Since in the embodiment of the present disclosure, before executing the first triggering task, the first task identifier corresponding to the first triggering task is first obtained, and the task identifier corresponding to the task that has been triggered is recorded through the task triggering information, and it is also set that if it is detected that there is a task identifier corresponding to the first triggering task in the task triggering information, the execution of the first triggering task is stopped. Therefore, when the first triggering task repeatedly enters the execution step, the electronic device will detect that there is already a first task identifier in the task triggering information, and thus stop executing the first triggering task again. It can be seen that the embodiment of the present disclosure achieves the purpose of avoiding the logical loop when automatically triggering tasks, solves the technical problem that the prior art cannot break out of the logical loop when automatically triggering tasks, and realizes the technical effect of improving the stability when automatically triggering tasks.

[0043] In an alternative embodiment, when there is no first task identifier in the task triggering information of the electronic device, the first task identifier is recorded in the task triggering information, and the first triggering task is executed.

[0044] Optionally, as Figure 2As shown, when the electronic device obtains the first task identifier and compares it with the task identifiers stored in the task trigger information, if it is found that the first task identifier does not exist in the task trigger information, the electronic device will execute the first trigger task and record the first task identifier in the task trigger information to indicate that the first trigger task has been executed. For example, when the electronic device detects that the first task identifier corresponding to trigger A does not exist in the trigger chain, the electronic device will execute the execution result of trigger A and record the first task identifier in the trigger chain.

[0045] In the above process, after the first trigger task is executed, by recording the first task identifier corresponding to the first trigger task in the task trigger information, when the first trigger task enters again, the electronic device will detect that the first task identifier already exists in the task trigger information and stop executing the first trigger task again, solving the technical problem in the prior art that it is impossible to break out of the logical loop when automatically triggering tasks.

[0046] In an optional embodiment, after the electronic device executes the first trigger task, it obtains the first execution result of executing the first trigger task. If the first execution result generates a second trigger instruction, it determines the second trigger task corresponding to the second trigger instruction and obtains the second task identifier corresponding to the second trigger task. Thus, when the second task identifier does not exist in the task trigger information, it records the second task identifier and the trigger relationship between the second task identifier and the first task identifier in the task trigger information.

[0047] Optionally, there may be a relationship between multiple tasks, that is, the first execution result of executing the first trigger task may be a condition for generating the second trigger instruction, where the second trigger instruction is used to determine the second trigger task. As Figure 2 shown, after the electronic device executes the first trigger task, it will obtain the first execution result of executing the first trigger task, and the execution result triggers trigger B, thereby generating a second trigger instruction and determining the second trigger task corresponding to the second trigger instruction. Similar to the first trigger task, the electronic device will obtain the second task identifier corresponding to the second trigger task and determine whether the second task identifier exists in the task trigger information. For example, it determines whether trigger B is in the entire trigger chain. If the second task identifier exists in the task trigger information, it stops triggering the execution of the second trigger task; if the second task identifier does not exist in the task trigger information, it triggers the execution of the second trigger task. For example, it executes the execution result of trigger B and records the second task identifier and the relationship between the second task identifier and the first task identifier in the task trigger information. For example, it records the trigger chain as A - B, and through this relationship, it can be characterized that the second trigger task is a task indirectly triggered by the first trigger task.

[0048] In the above process, when the second task identifier does not exist in the task trigger information, record the second task identifier and the relationship between the second task identifier and the first task identifier in the task trigger information, so as to represent the indirect relationship between the first trigger task and the second trigger task. Moreover, when the first trigger task and the second trigger task enter again, the electronic device will detect that the first task identifier and the second task identifier already exist in the task trigger information, so it will not execute the first trigger task and the second trigger task again, thus achieving the purpose of avoiding the logical loop when automatically triggering multiple tasks and realizing the technical effect of improving the stability when automatically triggering multiple tasks.

[0049] In an alternative embodiment, when the second task identifier does not exist in the task trigger information, the electronic device executes the second trigger task to obtain a second execution result.

[0050] Optionally, after the electronic device obtains the second task identifier, when it detects that the second task identifier does not exist in the task trigger information, it will execute the second trigger task and obtain a second execution result. For example, as Figure 2 shown, when it is determined that trigger B does not exist in the entire trigger chain, while recording the trigger chain "A - B", the execution result of trigger B will be executed, that is, the second trigger task will be executed, and the second execution result will be returned to the electronic device, where the second execution result includes but is not limited to: successful execution result and failed execution result.

[0051] In addition, a third trigger instruction can be continuously generated according to the second execution result, and the third trigger task corresponding to the third trigger instruction is determined, so as to obtain the third task identifier corresponding to the third trigger task. Then, when judging whether the third task identifier exists in the task trigger information, if the third task identifier does not exist in the task trigger information, record the third task identifier and the relationship between the third task identifier and the second task identifier and the first task identifier in the task trigger information. If the third task identifier exists in the task trigger information, stop triggering the execution of the third trigger task. For example, as Figure 2 shown, according to the execution result of trigger B, trigger C is triggered, that is, the third trigger task is determined. The electronic device judges whether trigger C is in the entire trigger chain. If it exists, stop triggering the execution of the execution task of trigger C. If it does not exist, execute the execution result of trigger C and record the trigger chain "A - B - C".

[0052] In the above process, when the second task identifier does not exist in the task trigger information, the electronic device can successfully execute the second trigger task and obtain the second execution result, thus realizing that on the basis of the first trigger task, the second trigger task is executed, that is, realizing that without the infinite loop caused by the logical closed loop, one trigger task can trigger another trigger task, greatly enriching the application scenario effect of the automatic trigger task.

[0053] In an alternative embodiment, when the second task identifier exists in the task trigger information, the electronic device stops executing the second trigger task.

[0054] Optionally, after the electronic device obtains the second task identifier, when it detects that the second task identifier exists in the task trigger information, it will stop executing the second trigger task. For example, as Figure 2 shown, when it is determined that trigger B exists in the entire trigger chain, the second trigger task fails to trigger and execute and will not continue to trigger, and the entire trigger chain terminates.

[0055] Through the above process, when a second trigger task enters again, the electronic device will detect that the second task identifier already exists in the task trigger information, so it will not execute the second trigger task again, thus solving the technical problem in the prior art that it is impossible to break out of the logical closed loop when automatically triggering tasks.

[0056] In an alternative embodiment, the task trigger information includes multiple subtask trigger information, and each subtask trigger information is at least used to record the task identifier of the corresponding trigger task.

[0057] Optionally, as Figure 2 shown, when the electronic device determines that trigger B is not in the entire trigger chain, while executing the execution result of trigger B, the electronic device will generate a trigger chain "A - B". When it is determined that trigger C is not in the entire trigger chain, while executing the execution result of trigger C, the electronic device will generate a trigger chain "A - B - C". Among them, the trigger chain "A - B" is a subtask trigger information, and the trigger chain "A - B - C" is also a subtask trigger information.

[0058] As can be seen from the above, in the embodiments of the present disclosure, a method is adopted in which whether to execute the first trigger task is determined according to whether there is a task identifier corresponding to the first trigger task in the task trigger information. By receiving the first trigger instruction, determining the first trigger task corresponding to the first trigger instruction, and obtaining the first task identifier corresponding to the first trigger task, when the first task identifier exists in the task trigger information, the execution of the first trigger task is stopped. Among them, the task corresponding to the task identifier stored in the task trigger information is used to directly or indirectly trigger the execution of the first trigger task. Since in the embodiments of the present disclosure, before executing the first trigger task, the first task identifier corresponding to the first trigger task is first obtained, and the task identifier corresponding to the task that has been triggered is recorded by setting the task trigger information. When it is detected that the task identifier corresponding to the first task exists in the task trigger information, the execution of the first task is stopped, thereby achieving the purpose of avoiding the logical loop when automatically triggering tasks, solving the technical problem that the prior art cannot break out of the logical loop when automatically triggering tasks, and realizing the technical effect of improving the stability when automatically triggering tasks.

[0059] Figure 3 is a block diagram of a device for executing tasks shown according to an exemplary embodiment. Refer to Figure 3 As shown, the task execution device includes: a receiving unit 301, an obtaining unit 303, and an executing unit 305. Among them, the first determining unit 301 is configured to execute receiving the first trigger instruction and determining the first trigger task corresponding to the first trigger instruction; the obtaining unit 303 is configured to execute obtaining the first task identifier corresponding to the first trigger task; the executing unit 305 is configured to execute stopping the execution of the first trigger task when the first task identifier exists in the task trigger information.

[0060] It should be noted here that the above receiving unit 301, obtaining unit 303, and executing unit 305 correspond to steps S11 to S13 in the above method embodiments. The examples and application scenarios implemented by the above modules and the corresponding steps are the same, but are not limited to the content disclosed in the above method embodiments for executing tasks. It should be noted that the above modules can run in a computer terminal as part of the device.

[0061] In an optional embodiment, the device for executing tasks further includes: a recording unit, configured to record the first task identifier in the task trigger information and execute the first trigger task when the first task identifier does not exist in the task trigger information.

[0062] In an alternative embodiment, the apparatus for performing tasks further includes: a first acquisition unit, a generation unit, a second acquisition unit, and a first recording unit. The first acquisition unit is configured to acquire a first execution result of performing a first trigger task. The generation unit is configured to determine a second trigger task corresponding to the second trigger instruction if the first execution result generates the second trigger instruction. The second acquisition unit is configured to acquire a second task identifier corresponding to the second trigger task. The first recording unit is configured to record the second task identifier in the task trigger information and the trigger relationship between the second task identifier and the first task identifier when the second task identifier does not exist in the task trigger information.

[0063] In an alternative embodiment, the apparatus for performing tasks further includes: a first execution unit configured to execute the second trigger task to obtain a second execution result when the second task identifier does not exist in the task trigger information.

[0064] In an alternative embodiment, the apparatus for performing tasks further includes: a second execution unit configured to stop executing the second trigger task when the second task identifier exists in the task trigger information.

[0065] In an alternative embodiment, the apparatus for performing tasks further includes: the task trigger information includes a plurality of subtask trigger information, and each subtask trigger information is at least used to record the task identifier of the corresponding trigger task.

[0066] Regarding the apparatus in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated herein.

[0067] According to an embodiment of the present disclosure, there is also provided an embodiment of an electronic device, including: a processor; a memory for storing executable instructions of the above processor; wherein, the above processor is configured to execute the above instructions to implement the method for performing tasks in any one of the above.

[0068] Optionally, Figure 4 is a block diagram of an electronic device shown according to an exemplary embodiment. Referring to Figure 4 as shown, the electronic device may include: at least one (only one is shown in the figure) processor 41, a memory 42, a peripheral interface 43, and so on.

[0069] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the method and device for executing tasks in the embodiments of the present disclosure. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, implements the above-mentioned method for executing tasks. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory may further include a memory remotely provided relative to the processor, and these remote memories can be connected to the computer terminal through a network. Examples of the above network include but are not limited to the Internet, enterprise intranet, local area network, mobile communication network, and combinations thereof.

[0070] The processor can call the information and application programs stored in the memory through the transmission device to execute the method steps of any one of the above-mentioned methods for executing tasks.

[0071] According to an embodiment of the present disclosure, there is also provided an embodiment of a computer-readable storage medium. When the instructions in the computer-readable storage medium are executed by the processor of the server, the electronic device can execute the method for executing tasks of any one of the above.

[0072] According to an embodiment of the present disclosure, there is provided an embodiment of a computer program product. The computer program product includes computer programs / instructions, and when the computer programs / instructions are executed by the processor, the method for executing tasks of any one of the above is implemented.

[0073] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0074] In the above embodiments of the present invention, the descriptions of each embodiment have their own emphases. For the parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

[0075] In several embodiments provided by the present disclosure, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only illustrative. For example, the above-mentioned unit division can be a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces, and the indirect coupling or communication connection of units or modules can be in an electrical or other form.

[0076] The units described above as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed over multiple units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0077] In addition, the functional units in various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0078] If the above-mentioned integrated units are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable computer storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a computer storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the above methods in various embodiments of the present invention. The aforementioned computer storage medium includes: USB flash drives, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), mobile hard disks, magnetic disks, or optical discs, etc., which can store program codes.

[0079] The above is only the preferred embodiment of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and modifications can be made, and these improvements and modifications should also be regarded as the protection scope of the present invention.

[0080] In addition, those skilled in the art will easily think of other implementation schemes of the present disclosure after considering the specification and practicing the invention disclosed herein. This application aims to cover any variations, uses, or adaptive changes of the present disclosure, which follow the general principles of the present disclosure and include the common general knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and embodiments are only regarded as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.

[0081] It should be understood that the present disclosure is not limited to the exact structure already described and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.

Claims

1. A method for performing a task, characterized in that, Including: Receiving a first trigger instruction and determining a first trigger task corresponding to the first trigger instruction; Obtaining a first task identifier corresponding to the first trigger task; When the first task identifier exists in the task trigger information, stopping the execution of the first trigger task, where the task corresponding to the task identifier stored in the task trigger information is used to directly or indirectly trigger the execution of the first trigger task; Obtaining a first execution result of executing the first trigger task; if the first execution result generates a second trigger instruction, determining a second trigger task corresponding to the second trigger instruction; obtaining a second task identifier corresponding to the second trigger task; when the second task identifier does not exist in the task trigger information, recording the second task identifier and the trigger relationship between the second task identifier and the first task identifier in the task trigger information; Obtaining a second execution result of executing the second trigger task, generating a third trigger instruction according to the second execution result, and determining a third trigger task corresponding to the third trigger instruction, obtaining a third task identifier corresponding to the third trigger task, if the third task identifier does not exist in the task trigger information, recording the third task identifier and the relationships between the third task identifier and the second task identifier and the first task identifier in the task trigger information, if the third task identifier exists in the task trigger information, stopping triggering the execution of the third trigger task.

2. The method for performing a task according to claim 1, wherein The method further includes: When the first task identifier does not exist in the task trigger information, recording the first task identifier in the task trigger information and executing the first trigger task.

3. The method for performing a task according to claim 1, wherein The method further includes: When the second task identifier does not exist in the task trigger information, executing the second trigger task to obtain a second execution result.

4. The method for performing a task according to claim 1, wherein The method further includes: When the second task identifier exists in the task trigger information, stopping the execution of the second trigger task.

5. The method for performing a task according to claim 1, wherein The task trigger information includes a plurality of subtask trigger information, and each subtask trigger information is at least used to record the task identifier of the corresponding trigger task.

6. A device for performing tasks, characterized in that, Including: A receiving unit configured to receive a first trigger instruction and determine a first trigger task corresponding to the first trigger instruction; An obtaining unit configured to obtain a first task identifier corresponding to the first trigger task; An execution unit configured to stop the execution of the first trigger task when the first task identifier exists in the task trigger information; The apparatus further includes: a first obtaining unit configured to obtain a first execution result of executing the first trigger task; a generating unit configured to determine a second trigger task corresponding to the second trigger instruction if the first execution result generates a second trigger instruction; a second obtaining unit configured to obtain a second task identifier corresponding to the second trigger task; a first recording unit configured to record the second task identifier and the trigger relationship between the second task identifier and the first task identifier in the task trigger information when the second task identifier does not exist in the task trigger information; The device is further configured to: obtain a second execution result of executing the second trigger task, generate a third trigger instruction according to the second execution result, determine a third trigger task corresponding to the third trigger instruction, obtain a third task identifier corresponding to the third trigger task, if the third task identifier does not exist in the task trigger information, record the third task identifier and the relationships between the third task identifier, the second task identifier, and the first task identifier in the task trigger information, and if the third task identifier exists in the task trigger information, stop triggering the execution of the third trigger task.

7. The apparatus for performing a task according to claim 6, wherein The device further includes: a recording unit configured to record the first task identifier in the task trigger information and execute the first trigger task when the first task identifier does not exist in the task trigger information.

8. The device for performing tasks according to claim 6, characterized in that, The device further includes: a first execution unit configured to execute the second trigger task to obtain a second execution result when the second task identifier does not exist in the task trigger information.

9. The device for performing tasks according to claim 6, wherein, The device further includes: a second execution unit configured to stop executing the second trigger task when the second task identifier exists in the task trigger information.

10. The apparatus for performing a task according to claim 6, wherein The task trigger information includes a plurality of subtask trigger information, and each subtask trigger information is at least used to record the task identifier of the corresponding trigger task.

11. An electronic device, characterized in that, including: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured to execute the instructions to implement the method for executing tasks according to any one of claims 1 to 5.

12. A computer-readable storage medium, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enable the electronic device to execute the method for executing tasks according to any one of claims 1 to 5.

13. A computer program product, comprising a computer program / instructions, characterized in that, The computer program / instructions, when executed by a processor, implement the method for executing tasks according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Task processing method, device and system based on distributed system

    CN107133086A

  • Task execution method, device and system

    CN109218507A