Workflow task processing method and device, computer equipment and storage medium
By obtaining and retrying the component subtasks of a workflow task, the problem of low efficiency in workflow task processing is solved, efficient task processing and applicability are achieved, and resource waste is avoided.
Patent Information
- Application Number
- CN202510587010.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-09-19
AI Technical Summary
In the existing technology, the workflow task processing efficiency of the same business link is low, and the differences between workflow tasks of different business objects are not fully distinguished, resulting in reduced processing efficiency, process jams and waste of resources.
By obtaining the pending workflow tasks, determining the target workflow tasks and calling the target type component to execute the subtasks, generating the retry subtasks and adding them to the component retry task list, the component subtasks are automatically retried until all component subtasks are completed.
It improves the processing efficiency and applicability of workflow tasks, avoids the trouble of retrying the entire process, realizes concurrent retry processing, and improves overall efficiency.
Smart Images

Figure CN120672270A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a workflow task processing method, device, computer equipment and storage medium in the fields of financial technology and medical health. Background Art
[0002] Workflow tasks play a vital role in daily operations in the fintech and healthcare sectors. For example, in the financial payment industry, the merchant onboarding process for payment companies involves workflow tasks such as data collection, organization and submission, compliance review, and risk control review. Another example is the generation of electronic inspection reports in the healthcare industry, which involves workflow tasks such as inspection data submission, organization and analysis, and result review.
[0003] In the prior art, for the same business link, a unified workflow task is usually adopted, which leads to some problems in the workflow task processing process. Even for the same business link, the workflow tasks of different business objects are different. For example, the entry materials of different types of merchants (corporate merchants, individual merchants, small and micro merchants, public institutions, etc.) are different, and the workflow task steps for entry should also be different, otherwise the efficiency of workflow task processing will be reduced. For another example, the inspection indicators of different project inspection reports are also different, and the workflow task steps for report generation should also be different, otherwise the efficiency of workflow task processing will also be reduced. In addition, process jams may occur during the workflow task processing process, consuming a lot of time and energy to conduct full-process investigation and handle exceptions, which reduces the efficiency of workflow task processing. Summary of the Invention
[0004] Based on this, it is necessary to provide a workflow task processing method, apparatus, computer equipment and storage medium to address the above technical issues, so as to solve the problem of low efficiency in existing workflow task processing.
[0005] A workflow task processing method, comprising: Acquire at least one to-be-processed workflow task, each of the to-be-processed workflow tasks including at least one component subtask and subtask sequence information corresponding to each component subtask; Determine a target workflow task from all the to-be-processed workflow tasks, determine a target subtask from all the component subtasks of the target workflow task according to the subtask sequence information, and call a target type component corresponding to the target subtask to execute the target subtask, thereby obtaining a subtask execution result of the target subtask; When the subtask execution result is execution failure, generating a target retry subtask according to the target subtask, and adding the target retry subtask to a component retry task list associated with the target type component; Performing task retry processing on the component retry task list through the target type component to obtain a subtask retry result of the target retry subtask; If the subtask retry result of the target retry subtask is a successful retry, then when there is no unexecuted component subtask in all the component subtasks of the target workflow task, the target workflow task is determined to be completed until all the pending workflow tasks are completed.
[0006] A workflow task processing device, comprising: A pending task acquisition module is configured to acquire at least one pending workflow task, each of which includes at least one component subtask and subtask sequence information corresponding to each component subtask; a component subtask execution module, configured to determine a target workflow task from all the workflow tasks to be processed, determine a target subtask from all the component subtasks of the target workflow task according to the subtask sequence information, and call a target type component corresponding to the target subtask to execute the target subtask, thereby obtaining a subtask execution result of the target subtask; a retry subtask generating module, configured to generate a target retry subtask according to the target subtask when the subtask execution result is an execution failure, and add the target retry subtask to a component retry task list associated with the target type component; a subtask retry processing module, configured to perform task retry processing on the component retry task list through the target type component, and obtain a subtask retry result of the target retry subtask; The workflow task completion module is used to determine that the target workflow task is completed if the subtask retry result of the target retry subtask is a successful retry, and when there is no unexecuted component subtask among all the component subtasks of the target workflow task, until all the pending workflow tasks are completed.
[0007] A computer device includes a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor. When the processor executes the computer-readable instructions, the above-mentioned workflow task processing method is implemented.
[0008] A computer-readable storage medium stores computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the workflow task processing method described above.
[0009] In the above-mentioned workflow task processing method, device, computer equipment and storage medium, the workflow task processing method obtains at least one workflow task to be processed, each workflow task to be processed includes at least one component subtask and subtask sequence information corresponding to each component subtask; determines the target workflow task from all workflow tasks to be processed, determines the target subtask from all component subtasks of the target workflow task according to the subtask sequence information, and calls the target type component corresponding to the target subtask to execute the target subtask, and obtains the subtask execution result of the target subtask; when the subtask execution result is execution failure, generates a target retry subtask according to the target subtask, and adds the target retry subtask to the component retry task list associated with the target type component; performs task retry processing on the component retry task list through the target type component to obtain the subtask retry result of the target retry subtask; if the subtask retry result of the target retry subtask is retry success, then when there is no unexecuted component subtask in all component subtasks of the target workflow task, it is determined that the target workflow task is completed until all workflow tasks to be processed are completed. Each workflow task of the present invention includes at least one component subtask and subtask sequence information corresponding to each component subtask. By componentizing the workflow, different components can execute different subtasks. The combination of component subtasks can generate different workflow tasks, thereby improving the applicability of workflow tasks and business scenarios and improving the efficiency of workflow task processing. At the same time, when the execution result of a subtask is an execution failure, the present invention automatically retrying the component subtask through the component retry task list associated with the target type component, avoiding the trouble of retrying the entire process. Different component subtasks do not interfere with each other, achieving concurrent retry processing, and further improving the overall efficiency of workflow task processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0011] Figure 1 This is a schematic diagram of an application environment of a workflow task processing method according to an embodiment of the present invention; Figure 2This is a flow chart of a workflow task processing method according to an embodiment of the present invention; Figure 3 It is a structural diagram of a workflow task processing device in one embodiment of the present invention; Figure 4 FIG. 1 is a schematic diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0012] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0013] The workflow task processing method provided in this embodiment can be applied to Figure 1 In an application environment, the client communicates with the server. The client includes but is not limited to various personal computers, laptops, smart phones, tablets and portable wearable devices. The server can be implemented with an independent server or a server cluster consisting of multiple servers. Different users initiate pending workflow tasks through the client. Each pending workflow task includes at least one component subtask and subtask sequence information corresponding to each component subtask. The server obtains at least one pending workflow task and processes each pending workflow task in the order of the component subtasks within the pending workflow task until all pending workflow tasks are completed.
[0014] The workflow task processing method of this embodiment can be applied to the financial and insurance industries. During the merchant onboarding process for payment companies, users may be different types of merchants (corporate merchants, individual merchants, small and micro merchants, public institutions, etc.), with varying onboarding steps. The corresponding pending workflow tasks involve different component subtasks (such as data collection, collation and submission, compliance review, and risk control review). The server obtains pending workflow tasks from these various sources and completes all pending workflow tasks using the workflow task processing method.
[0015] The workflow task processing method of this embodiment can also be applied to the healthcare industry. In the business process of generating electronic examination reports, users may be medical staff from different examination project departments. Different examination project reports have different examination indicators and report generation steps. The corresponding pending workflow tasks involve different component subtasks (such as examination data submission, indicator analysis, and result review). The server obtains these pending workflow tasks from different sources and completes all pending workflow tasks through the process of the workflow task processing method.
[0016] In one embodiment, if Figure 2 As shown, a workflow task processing method is provided, comprising the following steps S10-S50: S10: Acquire at least one to-be-processed workflow task, each of which includes at least one component subtask and subtask sequence information corresponding to each component subtask.
[0017] Understandably, a pending workflow task refers to a task that contains a series of workflow nodes and needs to be processed. The server can obtain only one pending workflow task or multiple pending workflow tasks at the same time. The server parses each pending workflow task and can obtain at least one component subtask in each pending workflow task and the subtask sequence information corresponding to each component subtask. A pending workflow task consists of multiple component subtasks, and a component subtask refers to a node task unit that can be executed independently according to the workflow. Subtask sequence information refers to information used to characterize the order in which component subtasks are executed according to the expected workflow logic, such as using digital codes to represent the execution dependency relationship between component subtasks. For example, a pending workflow task includes component subtask A and component subtask B. The subtask sequence information of component subtask A is "01", and the subtask sequence information of component subtask B is "02". Component subtask B can only be executed after component subtask A is completed.
[0018] S20. Determine a target workflow task from all the workflow tasks to be processed, determine a target subtask from all the component subtasks of the target workflow task according to the subtask sequence information, and call the target type component corresponding to the target subtask to execute the target subtask, and obtain the subtask execution result of the target subtask.
[0019] Understandably, the server needs to first determine the target workflow task from all pending workflow tasks in a workflow task processing process. The target workflow task refers to the pending workflow task that needs to be executed in the current processing process. When there is only one pending workflow task, the pending workflow task is directly determined as the target workflow task. When there are multiple pending workflow tasks, one pending workflow task can be randomly selected as the target workflow task, or one pending workflow task can be selected as the target workflow task according to pre-set screening rules (such as processing in chronological order or processing according to priority). At this time, the server needs to determine the pending workflow tasks as target workflow tasks one by one, and all pending workflow tasks can be completed after multiple corresponding workflow task processing processes.
[0020] After determining the target workflow task, the server obtains the component subtasks in the target workflow task and the subtask sequence information corresponding to each component subtask, and determines the target subtask from all the component subtasks based on the subtask sequence information. The target subtask refers to the component subtask that needs to be executed according to the logical order of the workflow. Then, the server calls the target type component corresponding to the target subtask to execute the target subtask and obtains the subtask execution result of the target subtask. A component refers to a component service unit in the server that is used to execute different subtask event operations, such as a risk control review operation component, an account opening operation component, and a signature submission operation component. Different subtask event operations can be achieved by calling components of different types of components. A target type component refers to a component used to execute the event operation corresponding to the target subtask. The subtask execution result is result information used to characterize whether feedback from the target type component has been received. Specifically, the server calls the target type component to execute the target subtask through the "CURRENT_COMPONENT varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT" command, and obtains the subtask execution result of the target subtask through the "RUN_STATUS varchar(32) COLLATEutf8mb4_bin DEFAULT NULL COMMENT" command.
[0021] S30: When the subtask execution result is execution failure, generate a target retry subtask according to the target subtask, and add the target retry subtask to a component retry task list associated with the target type component.
[0022] Understandably, the subtask execution results include successful execution and failed execution. Successful execution is used to characterize the result information received from the target type component within the preset subtask waiting time, such as audit passed or audit failed. Failed execution is used to characterize the result information not received from the target type component within the preset subtask waiting time, that is, the target type component cannot feedback normally. The preset subtask waiting time is a pre-set maximum waiting time for waiting for the target type component to feedback information when calling the target type component to execute the target subtask. The default value can be set or adjusted as needed, such as setting the default value to 1 second.
[0023] On the one hand, when the subtask execution result of the target subtask is an execution failure, the server generates a target retry subtask based on the target subtask, and adds the target retry subtask to the component retry task list associated with the target type component. The target retry subtask refers to the information set that needs to re-call the target type component to execute the target subtask. Components of different types of components can implement different subtask event operations, and different types of components correspond to their own different component retry task lists. The component retry task list is used to store the subtask list information of the retry subtask that has an associated relationship with the specified type of component. The component retry task list stores various pending workflow tasks that need to re-call the same type of component to implement the subtask event operation, that is, the component retry task list indicates which component subtask in which pending workflow task needs to re-call the component of this type.
[0024] On the other hand, if the subtask execution result of the target subtask is execution failure, it indicates that the workflow task processing flow for the current target workflow task is temporarily suspended. The target subtask needs to be retried successfully before continuing to complete the suspended target workflow task. The retry process is asynchronous. At the same time, the server returns the step of determining the target workflow task from all pending workflow tasks, triggering the workflow task processing flow for the next target workflow task until all pending workflow tasks are completed.
[0025] S40: Perform task retry processing on the component retry task list through the target type component to obtain a subtask retry result of the target retry subtask.
[0026] Understandably, the component retry task list of the target type component may include only the target retry subtask, or may include retry subtasks of other pending workflow tasks in addition to the target retry subtask. The server traverses all the retry subtasks in the component retry task list through the target type component to perform a round of task retry processing, and can obtain the subtask retry results of each retry subtask. The subtask retry result is the result information used to characterize whether the target type component feedback is received during the task retry processing. Each retry subtask in the component retry task list corresponds to its own subtask retry result, and further obtains the subtask retry result of the target retry subtask from it.
[0027] S50. If the subtask retry result of the target retry subtask is a successful retry, then when there is no unexecuted component subtask in all the component subtasks of the target workflow task, determine that the target workflow task is completed until all the pending workflow tasks are completed.
[0028] Understandably, the default state of a component subtask is unexecuted. All component subtasks in the target workflow task are unexecuted before the workflow task begins processing. As component subtasks successfully execute, the number of unexecuted component subtasks decreases. When there are no unexecuted component subtasks in the target workflow task, it indicates that all workflow nodes in the target workflow task have been executed, and the target workflow task can be determined to be completed.
[0029] When the subtask retry result of the target retry subtask is a successful retry, the server determines whether there are any unexecuted component subtasks among all the component subtasks of the target workflow task. If there are no unexecuted component subtasks among all the component subtasks of the target workflow task, the target workflow task is determined to be completed. If there are any unexecuted component subtasks among all the component subtasks of the target workflow task, the step of determining the target subtask from all the component subtasks of the target workflow task according to the subtask sequence information is returned, that is, the next target subtask is processed according to the workflow logic of the target workflow task until there are no unexecuted component subtasks among all the component subtasks of the target workflow task, and the target workflow task is determined to be completed. After completing the current target workflow task, the server returns the step of determining the target workflow task from all pending workflow tasks, triggering the workflow task processing flow for the next target workflow task, until all pending workflow tasks are completed.
[0030] This embodiment obtains at least one pending workflow task, each of which includes at least one component subtask and subtask sequence information corresponding to each component subtask; determines a target workflow task from all pending workflow tasks, determines a target subtask from all component subtasks of the target workflow task according to the subtask sequence information, and calls a target type component corresponding to the target subtask to execute the target subtask, thereby obtaining a subtask execution result of the target subtask; when the subtask execution result is an execution failure, generates a target retry subtask according to the target subtask, and adds the target retry subtask to a component retry task list associated with the target type component; performs task retry processing on the component retry task list through the target type component, thereby obtaining a subtask retry result of the target retry subtask; if the subtask retry result of the target retry subtask is a retry success, then when there is no unexecuted component subtask in all component subtasks of the target workflow task, the target workflow task is determined to be completed, until all pending workflow tasks are completed. Each workflow task in this embodiment includes at least one component subtask and subtask sequence information corresponding to each component subtask. By componentizing the workflow, different components can execute different subtasks. The combination of component subtasks can generate different workflow tasks, thereby improving the applicability of workflow tasks and business scenarios and improving the efficiency of workflow task processing. At the same time, when the execution result of a subtask is an execution failure, this embodiment automatically retries the component subtask through the component retry task list associated with the target type component, avoiding the trouble of retrying the entire process. Different component subtasks do not interfere with each other, achieving concurrent retry processing and further improving the overall efficiency of workflow task processing.
[0031] In one embodiment, step S10, i.e., before obtaining at least one workflow task to be processed, includes: S101, obtaining at least one task generation request, and determining the workflow task type of each task generation request; S102: determining, from all candidate component subtasks according to a preset type configuration rule, at least one component subtask corresponding to the workflow task type of each task generation request, and subtask sequence information corresponding to each component subtask; S103: Generate a to-be-processed workflow task corresponding to the task generation request according to all the component subtasks and subtask sequence information corresponding to the same task generation request.
[0032] Understandably, before obtaining at least one pending workflow task, the user can initiate a task generation request through the client's operation page, and the client will send the task generation request to the server. A task generation request refers to the request information sent by the client and received by the server to represent the workflow processing requirements. First, the server obtains at least one task generation request and parses each task generation request to determine the workflow task type of each task generation request. The workflow task type is the category information used to distinguish different workflow tasks based on purpose, execution method, and business scenario dimensions.
[0033] Next, the server determines at least one component subtask corresponding to the workflow task type of each task generation request from all candidate component subtasks according to the preset type configuration rules, as well as the subtask sequence information corresponding to each component subtask. Candidate component subtasks refer to a predefined series of optional small task modules for performing specific process operations. The preset type configuration rules are subtask combination template parameters that are pre-set according to the workflow logic requirements of different workflow task types. For different workflow task types, different standardized templates can be pre-established, including corresponding component subtasks and subtask sequence information. That is, under the preset type configuration rules, each workflow task type can be mapped to a set of component subtasks combined according to the subtask sequence information.
[0034] Finally, the server generates a pending workflow task corresponding to the task generation request based on all component subtasks and subtask sequence information. Each task generation request has a corresponding workflow task type, and each workflow task type can be mapped to a set of component subtasks combined according to the subtask sequence information to form a pending workflow task. Therefore, each task generation request forms a pending workflow task.
[0035] In one specific embodiment, during the onboarding process for payment company merchants, task generation requests initiated by different merchant types correspond to different workflow task types. Specifically, corporate merchants correspond to the enterprise onboarding type, individual merchants correspond to the individual household onboarding type, and public institutions correspond to the institutional onboarding type. Different workflow task types correspond to different pending workflow tasks, meaning that pending workflow tasks involve different component subtasks and subtask sequence information.
[0036] This embodiment maps the workflow task type of the task generation request to a custom combination of component subtasks and subtask sequence information based on preset type configuration rules, meeting the needs of different business scenarios and improving the efficiency and accuracy of generating workflow tasks to be processed.
[0037] In one embodiment, in step S20, that is, calling the target type component corresponding to the target subtask to execute the target subtask and obtaining the subtask execution result of the target subtask, the method further includes: S201: When the subtask execution result is successful, determine whether there is an unexecuted component subtask among all the component subtasks of the target workflow task; S202: If there are any unexecuted component subtasks, returning to the step of determining the target subtask from all the component subtasks of the target workflow task according to the subtask sequence information, and determining that the target workflow task is completed when no unexecuted component subtasks exist among all the component subtasks of the target workflow task; S203: If there is no unexecuted component subtask, determine that the target workflow task is completed.
[0038] Understandably, after the server obtains the subtask execution result of the target subtask, it determines whether the subtask execution result is successful or failed. When the subtask execution result of the target subtask is successful, it further determines whether there are unexecuted component subtasks among all the component subtasks of the target workflow task. If there are unexecuted component subtasks, return to the step of determining the target subtask from all the component subtasks of the target workflow task based on the subtask sequence information, that is, continue to process the next target subtask according to the workflow logic of the target workflow task, until there are no unexecuted component subtasks among all the component subtasks of the target workflow task, and then determine that the target workflow task is completed. If there are no unexecuted component subtasks, it indicates that the workflow logic of the target workflow task has ended, and the target workflow task can be directly determined to be completed.
[0039] This embodiment ensures that each component subtask in a workflow task can be executed in a predetermined order and under predetermined conditions, and the entire workflow task will be marked as completed only after all component subtasks are successfully executed, thereby realizing automated processing of workflow tasks.
[0040] In one embodiment, step S30, i.e., generating a target retry subtask according to the target subtask and adding the target retry subtask to a component retry task list associated with the target type component, includes: S301, obtaining the task code and task generation time of the target workflow task; S302: Generate a target retry subtask of the target workflow task according to the target subtask, task code, and task generation time; S303: Acquire an initial component retry task list associated with the target type component, and generate a component retry task list according to the target retry subtask and the initial component retry task list.
[0041] As you can understand, each pending workflow task has its own corresponding task code and task generation time. The task code is a unique identifier used to distinguish different pending workflow tasks. The task generation time refers to the generation time of the pending workflow task. When a component subtask requires retrying, the retry subtask is associated with both the pending workflow task to which the component subtask belongs and the specific component type that needs to be re-invoked. The server obtains the task code and task generation time of the target workflow task and, based on the target subtask, task code, and task generation time, generates a target retry subtask for the target workflow task, thus associating the target retry subtask with the target workflow task. Simultaneously, the server obtains the initial component retry task list associated with the target component type and adds the target retry subtask to the initial component retry task list, creating a component retry task list. This establishes the association between the target retry subtask and the target component type. The initial component retry task list is a predefined collection used to store retry subtasks that require invoking a specified component. The initial component retry task list may be empty or may already contain retry subtasks generated before the target workflow task is executed.
[0042] In the process of generating the target retry subtask, this embodiment is associated with the target workflow task and the target type component at the same time, and the target retry subtask is added to the component retry task list associated with the target type component, which helps to effectively perform subsequent retry operations and improve the reliability and stability of workflow task processing.
[0043] In one embodiment, in step S40, that is, performing task retry processing on the component retry task list by the target type component to obtain the subtask retry result of the target retry subtask, includes: S401: When there are multiple component retry subtasks of the pending workflow task in the component retry task list, obtain the task generation time corresponding to each component retry subtask; S402, determining a subtask retry order of each component retry subtask according to the task generation time; S403: traverse all the component retry subtasks according to the subtask retry order through the target type component to perform task retry processing, and obtain the subtask retry result of each component retry subtask; S404: Find a target retry subtask from all the component retry subtasks according to the task code of the target workflow task, and obtain a subtask retry result of the target retry subtask.
[0044] Understandably, the component retry task list for a target-type component may include only the target retry subtask, or it may include component retry subtasks for other pending workflow tasks in addition to the target retry subtask. A component retry subtask is a collection of information needed to re-invoke the target-type component to execute the component subtask. The target retry subtask is one of the component retry subtasks; that is, the target retry subtask is the component retry subtask associated with the target workflow task. When the component retry task list contains multiple component retry subtasks for pending workflow tasks, the server obtains the task generation time corresponding to each component retry subtask and determines the subtask retry order for each component retry subtask based on the task generation time. The subtask retry order refers to the order in which multiple component retry subtasks need to re-invoke the same type of component. The server then traverses all component retry subtasks in the subtask retry order using the target-type component, performing a round of task retry processing and obtaining the subtask retry results for each retry subtask. Next, the target retry subtask is found from all component retry subtasks according to the task code of the target workflow task, and the subtask retry result of the target retry subtask is obtained.
[0045] This embodiment utilizes the subtask retry order determined by task generation time to sequentially traverse all component retry subtasks, ensuring timely and effective retry processing when component subtasks encounter exceptions or fail, helping to improve the efficiency and stability of workflow task processing. Simultaneously, the subtask retry results of the target retry subtask are extracted and returned based on the task code of the target workflow task, accurately obtaining the retry results of the target retry subtask for further processing or analysis.
[0046] In one embodiment, in step S403, that is, traversing all the component retry subtasks according to the subtask retry order by the target type component to perform task retry processing, and obtaining the subtask retry result of each component retry subtask, the process includes: S4031, determining whether the subtask retry result of each component retry subtask is a retry success; S4032. If the subtask retry result is a retry failure, the component retry subtask with the subtask retry result of the retry failure is determined as an update retry subtask; S4033. Update the component retry task list associated with the target type component according to the update retry subtask to obtain an update component retry task list, so that the update component retry task list is processed by the target type component until the update component retry task list is empty.
[0047] Understandably, after the server performs task retry processing by traversing all component retry subtasks in the subtask retry order through the target type component, it is necessary to determine whether the subtask retry results of each component retry subtask are successful. If the subtask retry results of all component retry subtasks are successful, the component retry task list associated with the target type component is determined to be empty. If the subtask retry results of some component retry subtasks are retry failures, the component retry subtasks with retry failure subtask retry results are determined to be update retry subtasks. An update retry subtask refers to a component subtask that needs to be re-invoked after the target type component has performed task retry processing by traversing all component retry subtasks through the target type component. The server updates the component retry task list associated with the target type component based on the update retry subtask, obtaining an updated component retry task list, so that the target type component performs task retry processing on the updated component retry task list until the updated component retry task list is empty. The update component retry task list is a collection of update retry subtasks associated with the target type component. Specifically, the update method can be to remove the component retry subtasks that have been successfully retried from the original component retry task list and retain the component retry subtasks that need further retries, thereby obtaining the update component retry task list.
[0048] This embodiment implements the update operation of the component retry task list associated with the target type component, can effectively dynamically manage the component retry task list, ensure that the component retry subtasks are not lost, improve the retry success rate, and ensure the stability of the system.
[0049] In one embodiment, in step S40, that is, performing task retry processing on the component retry task list by the target type component and obtaining the subtask retry result of the target retry subtask, the following steps are included: S405. When the subtask retry result of the target retry subtask is retry failure, obtain the retry count of the target retry subtask, and determine whether the retry count reaches a preset retry count threshold; S406: If the number of retries has not reached the preset retry number threshold, determining the target retry subtask as an update retry subtask; S407. Update the component retry task list associated with the target type component according to the update retry subtask to obtain an update component retry task list, so that the update component retry task list is processed by the target type component until the subtask retry result of the target retry subtask is a successful retry.
[0050] It is understandable that in the process of the server performing task retry processing on the component retry task list through the target type component, it is necessary to count the number of retries of each component retry subtask in the component retry task list. Therefore, after the server obtains the subtask retry result of the target retry subtask, it determines whether the subtask retry result of the target retry subtask is a retry success or a retry failure. When the subtask retry result of the target retry subtask is a retry failure, the number of retries of the target retry subtask is obtained, and it is determined whether the number of retries reaches the preset retry number threshold. The preset retry number threshold is a pre-set maximum retry number critical value used to determine whether to stop retrying the component retry subtask.
[0051] If the target retry subtask's retry count has not yet reached the preset retry count threshold, it indicates that the target retry subtask is allowed to continue retrying. In this case, the target retry subtask is determined to be an update retry subtask, and the component retry task list associated with the target type component is updated according to the update retry subtask to obtain an update component retry task list. The target type component is used to perform task retry processing on the update component retry task list until the subtask retry result of the target retry subtask is a successful retry.
[0052] If the target retry subtask reaches the preset retry threshold, further retries for the target retry subtask cease, meaning it no longer needs to be added to the update component retry task list. At this point, the server generates a task alert corresponding to the target workflow task and sends it to the operations and maintenance manager, enabling them to analyze and address the anomaly. Task alerts are notifications used to alert operations and maintenance managers to intervene.
[0053] This embodiment improves the task success rate through a retry mechanism and prevents infinite retries based on a preset retry number threshold, thereby avoiding resource waste, effectively managing retry tasks, and ensuring the efficiency of workflow task processing.
[0054] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0055] In one embodiment, a workflow task processing device is provided, which corresponds one-to-one to the workflow task processing method in the above embodiment. Figure 3 As shown, the workflow task processing device includes a pending task acquisition module 10, a component subtask execution module 20, a retry subtask generation module 30, a subtask retry processing module 40 and a workflow task completion module 50. The functional modules are described in detail as follows: The pending task acquisition module 10 is configured to acquire at least one pending workflow task, each of which includes at least one component subtask and subtask sequence information corresponding to each component subtask; The component subtask execution module 20 is configured to determine a target workflow task from all the workflow tasks to be processed, determine a target subtask from all the component subtasks of the target workflow task according to the subtask sequence information, and call a target type component corresponding to the target subtask to execute the target subtask, thereby obtaining a subtask execution result of the target subtask; a retry subtask generating module 30 for generating a target retry subtask according to the target subtask when the subtask execution result is an execution failure, and adding the target retry subtask to a component retry task list associated with the target type component; The subtask retry processing module 40 is used to perform task retry processing on the component retry task list through the target type component to obtain the subtask retry result of the target retry subtask; The workflow task completion module 50 is used to determine that the target workflow task is completed if the subtask retry result of the target retry subtask is a successful retry, and when there is no unexecuted component subtask in all the component subtasks of the target workflow task, until all the pending workflow tasks are completed.
[0056] In one embodiment, the pending task acquisition module 10 includes: A task type determination unit, configured to obtain at least one task generation request and determine a workflow task type for each task generation request; a subtask information determining unit, configured to determine, from all candidate component subtasks according to a preset type configuration rule, at least one component subtask corresponding to the workflow task type of each task generation request, and subtask sequence information corresponding to each component subtask; The workflow task generating unit is configured to generate a to-be-processed workflow task corresponding to the task generation request according to all the component subtasks and subtask sequence information corresponding to the same task generation request.
[0057] In one embodiment, the component subtask execution module 20 includes: an unexecuted subtask determining unit, configured to determine whether there is an unexecuted component subtask among all the component subtasks of the target workflow task when the subtask execution result is successful; a subtask sequence execution unit configured to, if there is any unexecuted component subtask, return to the step of determining a target subtask from all the component subtasks of the target workflow task according to the subtask sequence information, and determine that the target workflow task is completed when no unexecuted component subtask exists among all the component subtasks of the target workflow task; The target workflow task completion unit is configured to determine that the target workflow task is completed if there is no unexecuted component subtask.
[0058] In one embodiment, the retry subtask generation module 30 includes: A task information acquisition unit, configured to acquire the task code and task generation time of the target workflow task; A target retry subtask generating unit, configured to generate a target retry subtask of the target workflow task according to the target subtask, the task code and the task generation time; The component retry task list generating unit is configured to obtain an initial component retry task list associated with the target type component, and generate a component retry task list according to the target retry subtask and the initial component retry task list.
[0059] In one embodiment, the subtask retry processing module 40 includes: a retry subtask information acquisition unit, configured to acquire a task generation time corresponding to each component retry subtask when there are multiple component retry subtasks of the to-be-processed workflow task in the component retry task list; a subtask retry order determining unit, configured to determine a subtask retry order of each of the component retry subtasks according to the task generation time; a subtask retry execution unit, configured to traverse all the component retry subtasks according to the subtask retry order through the target type component to perform task retry processing, and obtain a subtask retry result of each component retry subtask; The subtask retry result acquiring unit is configured to find a target retry subtask from all the component retry subtasks according to the task code of the target workflow task, and acquire a subtask retry result of the target retry subtask.
[0060] In one embodiment, the subtask retry processing module 40 further includes: a subtask retry result analysis unit, configured to determine whether the subtask retry result of each component retry subtask is a successful retry; a retry failure processing unit, configured to, if a subtask retry result is a retry failure, determine the component retry subtask with the subtask retry result as the retry failure as an update retry subtask; A component retry task list update unit is used to update the component retry task list associated with the target type component according to the update retry subtask to obtain an updated component retry task list, so that the updated component retry task list is subjected to task retry processing through the target type component until the updated component retry task list is empty.
[0061] In one embodiment, the subtask retry processing module 40 further includes: a retry count acquisition unit, configured to, when a subtask retry result of the target retry subtask is a retry failure, acquire the retry count of the target retry subtask and determine whether the retry count reaches a preset retry count threshold; a retry count analysis unit, configured to determine the target retry subtask as an update retry subtask if the retry count has not reached the preset retry count threshold; The subtask multi-round retry unit is used to update the component retry task list associated with the target type component according to the update retry subtask, obtain the updated component retry task list, and perform task retry processing on the updated component retry task list through the target type component until the subtask retry result of the target retry subtask is a successful retry.
[0062] For the specific definition of the workflow task processing device, please refer to the definition of the workflow task processing method above, which will not be repeated here. The various modules in the above-mentioned workflow task processing device can be implemented in whole or in part by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
[0063] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a readable storage medium and an internal memory. The readable storage medium stores an operating system, computer-readable instructions and a database. The internal memory provides an environment for the operation of the operating system and computer-readable instructions in the readable storage medium. The database of the computer device is used to store data involved in the workflow task processing method. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer-readable instructions are executed by the processor, a workflow task processing method is implemented. The readable storage medium provided in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.
[0064] In one embodiment, a computer device is provided, comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor. When the processor executes the computer-readable instructions, the following steps are implemented: Acquire at least one to-be-processed workflow task, each of the to-be-processed workflow tasks including at least one component subtask and subtask sequence information corresponding to each component subtask; Determine a target workflow task from all the to-be-processed workflow tasks, determine a target subtask from all the component subtasks of the target workflow task according to the subtask sequence information, and call a target type component corresponding to the target subtask to execute the target subtask, thereby obtaining a subtask execution result of the target subtask; When the subtask execution result is execution failure, generating a target retry subtask according to the target subtask, and adding the target retry subtask to a component retry task list associated with the target type component; Performing task retry processing on the component retry task list through the target type component to obtain a subtask retry result of the target retry subtask; If the subtask retry result of the target retry subtask is a successful retry, then when there is no unexecuted component subtask in all the component subtasks of the target workflow task, the target workflow task is determined to be completed until all the pending workflow tasks are completed.
[0065] In one embodiment, one or more computer-readable storage media storing computer-readable instructions are provided. The computer-readable storage media provided in this embodiment include non-volatile computer-readable storage media and volatile computer-readable storage media. The computer-readable storage media store computer-readable instructions that, when executed by one or more processors, implement the following steps: Acquire at least one to-be-processed workflow task, each of the to-be-processed workflow tasks including at least one component subtask and subtask sequence information corresponding to each component subtask; Determine a target workflow task from all the to-be-processed workflow tasks, determine a target subtask from all the component subtasks of the target workflow task according to the subtask sequence information, and call a target type component corresponding to the target subtask to execute the target subtask, thereby obtaining a subtask execution result of the target subtask; When the subtask execution result is execution failure, generating a target retry subtask according to the target subtask, and adding the target retry subtask to a component retry task list associated with the target type component; Performing task retry processing on the component retry task list through the target type component to obtain a subtask retry result of the target retry subtask; If the subtask retry result of the target retry subtask is a successful retry, then when there is no unexecuted component subtask in all the component subtasks of the target workflow task, the target workflow task is determined to be completed until all the pending workflow tasks are completed.
[0066] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware through computer-readable instructions. The computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When executed, the computer-readable instructions can include the processes of the above-described method embodiments. Any reference to memory, storage, database, or other media used in the embodiments provided by the present invention may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0067] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0068] The non-Company software tools or components that appear in the embodiments of this application are merely examples and do not represent actual use. The above embodiments are only used to illustrate the technical solutions of the present invention, not to limit them. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some of the technical features therein with equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the scope of protection of the present invention.
Claims
1. A workflow task processing method, characterized in that: include: Acquire at least one to-be-processed workflow task, each of the to-be-processed workflow tasks including at least one component subtask and subtask sequence information corresponding to each component subtask; Determine a target workflow task from all the to-be-processed workflow tasks, determine a target subtask from all the component subtasks of the target workflow task according to the subtask sequence information, and call a target type component corresponding to the target subtask to execute the target subtask, thereby obtaining a subtask execution result of the target subtask; When the subtask execution result is execution failure, generating a target retry subtask according to the target subtask, and adding the target retry subtask to a component retry task list associated with the target type component; Performing task retry processing on the component retry task list through the target type component to obtain a subtask retry result of the target retry subtask; If the subtask retry result of the target retry subtask is a successful retry, then when there is no unexecuted component subtask in all the component subtasks of the target workflow task, the target workflow task is determined to be completed until all the pending workflow tasks are completed.
2. The workflow task processing method according to claim 1, wherein: Before obtaining at least one workflow task to be processed, the method includes: Obtain at least one task generation request, and determine the workflow task type of each task generation request; Determining at least one component subtask corresponding to the workflow task type of each task generation request and subtask sequence information corresponding to each component subtask from all candidate component subtasks according to a preset type configuration rule; A to-be-processed workflow task corresponding to the task generation request is generated according to all the component subtasks and subtask sequence information corresponding to the same task generation request.
3. The workflow task processing method according to claim 1, wherein: After calling the target type component corresponding to the target subtask to execute the target subtask and obtaining the subtask execution result of the target subtask, the method further includes: When the subtask execution result is successful, determining whether there is an unexecuted component subtask among all the component subtasks of the target workflow task; If there are unexecuted component subtasks, returning to the step of determining the target subtask from all the component subtasks of the target workflow task according to the subtask sequence information, and determining that the target workflow task is completed when there are no unexecuted component subtasks among all the component subtasks of the target workflow task; If there is no unexecuted component subtask, it is determined that the target workflow task is completed.
4. The workflow task processing method according to claim 1, wherein: Generating a target retry subtask according to the target subtask, and adding the target retry subtask to a component retry task list associated with the target type component, includes: Obtaining the task code and task generation time of the target workflow task; Generate a target retry subtask of the target workflow task according to the target subtask, task code and task generation time; An initial component retry task list associated with the target type component is obtained, and a component retry task list is generated according to the target retry subtask and the initial component retry task list.
5. The workflow task processing method according to claim 1, wherein: The performing task retry processing on the component retry task list by the target type component to obtain the subtask retry result of the target retry subtask includes: When there are multiple component retry subtasks of the to-be-processed workflow task in the component retry task list, obtaining the task generation time corresponding to each component retry subtask; Determining a subtask retry order of each component retry subtask according to the task generation time; Traversing all the component retry subtasks according to the subtask retry order through the target type component to perform task retry processing, and obtaining the subtask retry result of each component retry subtask; A target retry subtask is found from all the component retry subtasks according to the task code of the target workflow task, and a subtask retry result of the target retry subtask is obtained.
6. The workflow task processing method according to claim 5, wherein: The step of traversing all the component retry subtasks according to the subtask retry order through the target type component to perform task retry processing and obtaining the subtask retry result of each component retry subtask includes: Determine whether the subtask retry result of each component retry subtask is a retry success; If the subtask retry result is a retry failure, the component retry subtask with the subtask retry result of the retry failure is determined as an update retry subtask; The component retry task list associated with the target type component is updated according to the update retry subtask to obtain an update component retry task list, so that the update component retry task list is retried through the target type component until the update component retry task list is empty.
7. The workflow task processing method according to claim 1, wherein: After performing task retry processing on the component retry task list through the target type component and obtaining the subtask retry result of the target retry subtask, the method includes: When the subtask retry result of the target retry subtask is retry failure, obtaining the retry count of the target retry subtask, and determining whether the retry count reaches a preset retry count threshold; If the number of retries has not reached the preset retry number threshold, determining the target retry subtask as an update retry subtask; According to the update retry subtask, the component retry task list associated with the target type component is updated to obtain an update component retry task list, so that the update component retry task list is processed by the target type component until the subtask retry result of the target retry subtask is a successful retry.
8. A workflow task processing device, characterized in that: include: A pending task acquisition module is configured to acquire at least one pending workflow task, each of which includes at least one component subtask and subtask sequence information corresponding to each component subtask; a component subtask execution module, configured to determine a target workflow task from all the workflow tasks to be processed, determine a target subtask from all the component subtasks of the target workflow task according to the subtask sequence information, and call a target type component corresponding to the target subtask to execute the target subtask, thereby obtaining a subtask execution result of the target subtask; a retry subtask generating module, configured to generate a target retry subtask according to the target subtask when the subtask execution result is an execution failure, and add the target retry subtask to a component retry task list associated with the target type component; a subtask retry processing module, configured to perform task retry processing on the component retry task list through the target type component, and obtain a subtask retry result of the target retry subtask; The workflow task completion module is used to determine that the target workflow task is completed if the subtask retry result of the target retry subtask is a successful retry, and when there is no unexecuted component subtask among all the component subtasks of the target workflow task, until all the pending workflow tasks are completed.
9. A computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein: When the processor executes the computer-readable instructions, the workflow task processing method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing computer-readable instructions, characterized in that: When the computer-readable instructions are executed by one or more processors, the one or more processors are caused to perform the workflow task processing method according to any one of claims 1 to 7.