Method and device for processing task exception

Through the data interaction between task running threads and exception handling threads, exception handling pipelines and strategies are used to process exceptions in batch task flow, solving the problems of flexibility and efficiency in the existing technology, and achieving efficient and reliable exception handling.

CN120371589AActive Publication Date: 2025-07-25CHINA SECURITIES DEPOSITORY & CLEARING CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510873094.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-26
Publication Date
2025-07-25
Estimated Expiration
2045-06-26

AI Technical Summary

Technical Problem

When handling task node exceptions in batch task process, the prior art has problems such as poor flexibility, low efficiency, inability to retain the abnormal site, and requires manual intervention, which is particularly obvious in business systems in the financial field.

Method used

Through the data interaction between the task running thread and the exception handling thread, the exception processing pipeline is used to transmit task exception data, and the task exception is handled based on the exception handling strategy, including building an exception handling pipeline and sending exception handling strategy.

Benefits of technology

It improves the flexibility and efficiency of task exception handling, automatically records the abnormal site, reduces control complexity, and improves response efficiency and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371589A_ABST
    Figure CN120371589A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a device for processing task exception, and relates to the technical field of task processing. A specific embodiment of the method comprises the steps of sending task exception data corresponding to a task node to an exception handling thread under the condition that the task node which is being executed is detected to be exceptional by utilizing a task running thread; binding the task exception data to an exception handling pipeline by using an exception handling thread, and returning a receiving end of the exception handling pipeline to the task running thread; and receiving an exception handling strategy for the task exception data through a receiving end of the exception handling pipeline by utilizing the task running thread, and handling the task exception based on the exception handling strategy. According to the embodiment of the invention, the exception processing is completed through the data interaction between the task running thread and the exception processing thread, so that the flexibility and efficiency of processing the task exception are improved, and the reliability of processing the task exception is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of task processing, and in particular, to a method and device for processing task exceptions. Background Art

[0002] In an application business processing system, a batch processing task flow can be adopted to improve the business processing efficiency. In the execution of the batch processing task flow, it is usually necessary to schedule different task flows and task nodes in the task flow.

[0003] In view of the situation where an exception occurs in a task node in the batch processing task flow, the existing methods usually record the exception status, send the exception status information to the operation and maintenance personnel, and wait for the operation and maintenance personnel to trigger the subsequent task flow after handling the exception. The existing methods have problems such as being unable to retain the exception site and the need to separately handle the task blocking logic in the waiting state. With the improvement of the performance requirements of application services, especially for financial services, the existing methods have problems of poor flexibility and low efficiency in processing tasks. Summary of the Invention

[0004] In view of this, an embodiment of the present invention provides a method and device for processing task exceptions, which can use a task running thread to execute one or more task nodes; in the case of detecting an exception in the currently executing task node, send the task exception data corresponding to the task node to an exception handling thread; use the exception handling thread to bind the task exception data to an exception handling pipeline corresponding to the task node, and return the receiving end of the exception handling pipeline to the task running thread; use the task running thread to receive an exception handling strategy for the task exception data through the receiving end of the exception handling pipeline, and process the task exception based on the exception handling strategy. The embodiment of the present invention completes exception handling through data interaction between the task running thread and the exception handling thread, improves the flexibility and efficiency of processing task exceptions, and improves the reliability of processing task exceptions.

[0005] To achieve the above object, according to one aspect of an embodiment of the present invention, there is provided a method for processing task exceptions, characterized by comprising: using a task running thread to execute one or more task nodes; in the case of detecting an exception in the currently executing task node, sending the task exception data corresponding to the task node to an exception handling thread; using the exception handling thread to bind the task exception data to an exception handling pipeline corresponding to the task node, and returning the receiving end of the exception handling pipeline to the task running thread; using the task running thread to receive an exception handling strategy for the task exception data through the receiving end of the exception handling pipeline, and processing the task exception based on the exception handling strategy.

[0006] Optionally, before binding the task exception data to the exception handling pipeline corresponding to the task node by using the exception handling thread, it further includes: receiving the task exception data by using the exception handling thread, and obtaining the task node exception feature value included in the task exception data; constructing a corresponding exception handling pipeline for the task node based on the task node exception feature value.

[0007] Optionally, in the case where it is detected that the currently executing task node has an exception, it further includes: writing the task exception data corresponding to the task node into the task log data source; so that the exception handling module can obtain the task exception data from the task log data source and send the exception handling policy corresponding to the task exception data to the exception handling thread.

[0008] Optionally, the method for handling exceptions further includes: receiving, by using the exception handling thread, the exception handling policy for the task exception data sent by the exception handling module; sending the received exception handling policy to the task running thread.

[0009] Optionally, receiving, by using the exception handling thread, the exception handling policy for the task exception data sent by the exception handling module further includes: obtaining the task node exception feature value included in the task exception data; searching, from multiple exception handling pipelines, for the target exception handling pipeline bound to the task node exception feature value; sending the exception handling policy to the task running thread includes: using the sending end of the target exception handling pipeline to send the exception handling policy to the task running thread.

[0010] Optionally, the method for handling exceptions further includes: an exception handling service port is provided; sending the task exception data corresponding to the task node to the exception handling thread includes: using the task running thread to connect to the exception handling service port, and sending the task exception data corresponding to the task node to the exception handling thread through the exception record service provided by the exception handling service port.

[0011] Optionally, the method for handling exceptions further includes: an exception handling service port is provided; after the exception handling module obtains the task exception data from the task log data source and sends the exception handling policy corresponding to the task exception data to the exception handling thread, it further includes: using the exception handling module to connect to the exception handling service port, and sending the exception handling policy for the task node to the exception handling thread through the exception handling service provided by the exception handling service port.

[0012] To achieve the above object, according to the second aspect of the embodiments of the present invention, there is provided an apparatus for handling task exceptions, which is characterized in that it includes: an exception detection module, a pipeline binding module, and an exception handling module; wherein, The detection anomaly module is used to execute one or more task nodes by using the task running thread; in the case where an anomaly is detected in the currently executing task node, send the task anomaly data corresponding to the task node to the anomaly handling thread; The binding pipeline module is used to bind the task anomaly data to the anomaly handling pipeline corresponding to the task node by using the anomaly handling thread, and return the receiving end of the anomaly handling pipeline to the task running thread; The anomaly handling module is used to receive the anomaly handling strategy for the task anomaly data via the receiving end of the anomaly handling pipeline by using the task running thread, and handle the task anomaly based on the anomaly handling strategy.

[0013] Optionally, the device for handling task anomalies, before binding the task anomaly data to the anomaly handling pipeline corresponding to the task node by using the anomaly handling thread, further includes: after receiving the task anomaly data by using the anomaly handling thread, obtaining the task node anomaly characteristic value included in the task anomaly data; constructing the corresponding anomaly handling pipeline for the task node based on the task node anomaly characteristic value.

[0014] Optionally, the device for handling task anomalies, in the case where an anomaly is detected in the currently executing task node, further includes: writing the task anomaly data corresponding to the task node into the task log data source; so that the anomaly handling module can obtain the task anomaly data from the task log data source.

[0015] Optionally, the device for handling task anomalies is further used to receive the anomaly handling strategy for the task anomaly data sent by the anomaly handling module by using the anomaly handling thread; send the received anomaly handling strategy to the task running thread.

[0016] Optionally, the device for handling task anomalies, when using the anomaly handling thread to receive the anomaly handling strategy for the task anomaly data sent by the anomaly handling module, further includes: obtaining the task node anomaly characteristic value included in the task anomaly data; searching for the target anomaly handling pipeline bound to the task node anomaly characteristic value from multiple anomaly handling pipelines; sending the anomaly handling strategy to the task running thread, including: sending the anomaly handling strategy to the task running thread by using the sending end of the target anomaly handling pipeline.

[0017] Optionally, the device for handling anomalies is further used to be provided with an anomaly handling service port; sending the task anomaly data corresponding to the task node to the anomaly handling thread, including: using the task running thread to connect to the anomaly handling service port, and sending the task anomaly data corresponding to the task node to the anomaly handling thread through the anomaly record service provided by the anomaly handling service port.

[0018] Optionally, the device for handling exceptions is further configured with an exception handling service port; when using the exception handling module to obtain task exception data from the task log data source, it further includes: using the exception handling module to connect to the exception handling service port, and through the exception handling service provided by the exception handling service port, sending an exception handling policy for the task node to the exception handling thread.

[0019] To achieve the above object, according to the third aspect of the embodiments of the present invention, there is provided an electronic device for handling task exceptions, characterized in that it includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enabling the one or more processors to implement any one of the methods for handling task exceptions as described above.

[0020] To achieve the above object, according to the fourth aspect of the embodiments of the present invention, there is provided a computer-readable medium having a computer program stored thereon, characterized in that when the program is executed by a processor, it implements any one of the methods for handling task exceptions as described above.

[0021] To achieve the above object, according to the fifth aspect of the embodiments of the present invention, there is provided a computer program product including a computer program, characterized in that when the computer program is executed by a processor, it implements any one of the methods for handling task exceptions as described above.

[0022] One embodiment of the above invention has the following advantages or beneficial effects: it is possible to use the task running thread to execute one or more task nodes; in the case of detecting an exception in the currently executing task node, sending the task exception data corresponding to the task node to the exception handling thread; using the exception handling thread to bind the task exception data to the exception handling pipeline, and returning the receiving end of the exception handling pipeline to the task running thread; using the task running thread to receive the exception handling policy for the task exception data via the receiving end of the exception handling pipeline, and handling the task exception based on the exception handling policy. The embodiment of the present invention completes exception handling through data interaction between the task running thread, the exception handling thread, and the exception handling module, improving the flexibility, efficiency, and reliability of exception handling.

[0023] The further effects of the above non-conventional optional methods will be described in conjunction with specific embodiments below. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention. Among them: Figure 1 is a flowchart of a method for handling task exceptions provided by an embodiment of the present invention; Figure 2 It is a schematic diagram of an interaction process for handling task exceptions provided by an embodiment of the present invention; Figure 3 It is a schematic diagram of a process of another method for handling task exceptions provided by an embodiment of the present invention; Figure 4 It is a schematic diagram of the structure of a device for handling task exceptions provided by an embodiment of the present invention; Figure 5 It is an exemplary system architecture diagram to which the embodiments of the present invention can be applied; Figure 6 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing the embodiments of the present invention. Detailed implementation manners

[0025] The following makes an explanation of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted below.

[0026] In various types of application software systems, a batch processing system is often included in a business processing system; for business systems with relatively complex operations and high performance requirements, such as financial business systems, settlement business systems, e-commerce business systems, etc., the batch processing systems used usually require an independent batch processing scheduling system to flexibly configure the batch processing task process and monitor the running status of the batch processing task process in real time.

[0027] In a batch processing task process, multiple task nodes are usually included, and one task node corresponds to one business function; for the case where there may be business dependencies between business functions, multiple task nodes have an execution order when being scheduled for execution, and there may be one or more pre-task nodes or post-task nodes for one task node; for the case where there are no business dependencies between multiple business functions, multiple task nodes can be executed in parallel.

[0028] During the operation and scheduling of a batch processing task process, when an exception occurs in the business execution of any task node (for example: network connection exception, interface call exception, memory resource exception, CPU resource exception, etc.), in the existing methods, the following several ways of handling exceptions are usually adopted: A. The batch processing scheduling system continues to execute the subsequent task process according to the pre-set rules (automatically retry or execute the error branch); B. The batch processing scheduling system records the status of the error task node and waits for manual operation to trigger or skip the task node again.

[0029] Due to the limitations of pre-established rules, Method A has problems of poor flexibility and generality. Method B has the problem that it cannot preserve the error scene. The batch scheduling system must separately consider how to block the subsequent task process when a task node encounters an error, which increases the complexity of the scheduling process control. And when dealing with exceptions, it is necessary to restart the task node scheduling thread or re-dispatch the faulty task node.

[0030] In view of this, as Figure 1 shown, an embodiment of the present invention provides a method for handling task exceptions, which may include the following steps: Step S101: Use a task running thread to execute one or more task nodes; when it is detected that an exception exists in the currently executing task node, send the task exception data corresponding to the task node to the exception handling thread.

[0031] Specifically, in the embodiment of the present invention, a task running thread and an exception handling thread are set and run in the batch scheduling system. Use the task running thread to execute one or more task nodes. When it is detected that an exception exists in the currently executing task node, obtain the task exception data corresponding to the task node, and send the task exception data corresponding to the task node to the exception handling thread; when using the task running thread to execute one or more task nodes, a synchronous serial execution method can be adopted.

[0032] Among them, there can be multiple types of exceptions when a task node encounters an exception. For example, for connection and communication error types: when a task node has a network connection exception during operation, since the task node needs to obtain data or interact with other systems through the network, it may cause problems such as excessive data delay or packet loss; or, when a task node depends on the interface of other systems or services, an exception such as a failed interface call may occur due to network connection problems; for example, when a task node calls a third-party payment interface for financial transaction operations, if the interface parameter transmission is incorrect, it will cause the transaction to fail; for the data exception type of the task node: for example, the task node runs abnormally due to data loss, format error, data inconsistency, etc.; for the resource exception type of the task node running environment: for example, insufficient memory. A task node may require a large amount of memory to process data or perform operations during operation. If the memory allocated to the task node by the system is insufficient, the task will fail. Insufficient CPU resources: When the computing power of the task node is large and the CPU resources of the system are limited, it may cause the task to execute slowly or even fail to complete. Storage resource problems: A task node may need to read and write storage devices such as disks. If the storage device fails, has insufficient space, or has read / write permission problems, it will cause the task to go wrong, etc.; The present invention does not limit the specific business logic and exception types of the task node.

[0033] Further, when it is detected that there is an abnormality in the task node, obtain the task exception data corresponding to the task node, and send the task exception data corresponding to the task node to the exception handling thread; specifically, the task exception data may include the unique identifier of the task node, the timestamp of the abnormality occurrence, and the specific information of the abnormality; among them, the unique identifier of the task node and the timestamp of the abnormality occurrence can be combined into the abnormality feature value of the task node in a certain abnormality (i.e., the task node abnormality feature value); it can be understood that for the same task node, abnormalities may occur multiple times at different timestamps; by combining the unique identifier of the task node and the timestamp of the abnormality occurrence, each abnormality of the task node can be uniquely identified; the specific information of the abnormality may include various detailed information such as the abnormality type, the abnormality code, and the abnormality text description.

[0034] Step S102: Use the exception handling thread to bind the task exception data to the exception handling pipeline corresponding to the task node, and return the receiving end of the exception handling pipeline to the task running thread.

[0035] Specifically, in the embodiment of the present invention, an exception handling thread is set and run in the batch processing scheduling system; among them, the exception handling thread receives the task exception data sent by the task running thread.

[0036] Further, when the exception handling thread receives the task exception data sent by the task running thread, obtain the task node abnormality feature value from the task exception data, and construct a new exception handling pipeline corresponding to the task node abnormality feature value based on the task node abnormality feature value; that is, an exception handling pipeline is bound to the exception data of a task node. That is, before using the exception handling thread to bind the task exception data to the exception handling pipeline corresponding to the task node, it further includes: after the exception handling thread receives the task exception data, obtain the task node abnormality feature value included in the task exception data; construct a corresponding exception handling pipeline for the task node based on the task node abnormality feature value. Among them, the exception handling pipeline (PIPE) is a mechanism for full-duplex, point-to-point data transmission and communication between different threads (task running thread and exception handling thread), one thread can put data into one end of the pipeline (such as the sending end), and the other thread can obtain data from the other end of the pipeline (such as the receiving end), so as to realize data interaction between threads.

[0037] Further, use the exception handling thread to return the receiving end of the constructed exception handling pipeline to the task running thread.

[0038] Step S103: Use the task running thread to receive the exception handling strategy for the task exception data via the receiving end of the exception handling pipeline, and handle the task exception based on the exception handling strategy.

[0039] Specifically, in the embodiments of the present invention, an exception handling module is used to determine a corresponding exception handling strategy for task exception data; among them, the exception handling module (external program) can be a separate application independent of the batch scheduling system.

[0040] In the embodiments of the present invention, a task running thread is used to execute one or more task nodes. In the case where an exception is detected in the task node being executed, it further includes: writing the task exception data corresponding to the task node into the task log data source; so that the exception handling module can obtain the task exception data from the task log data source, that is, the exception handling module monitors the log changes of the task log data source and obtains and processes the task exception data from the task log data source in real time.

[0041] Further, the exception handling module is used to obtain the task exception data from the task log data source and send the exception handling strategy corresponding to the task exception data to the exception handling thread. Among them, the exception handling strategy is determined based on the characteristics of the task exception data. The party that determines the exception handling strategy according to the characteristics of the task exception data can be an operation and maintenance personnel, or the exception handling strategy can be determined according to the pre-configured rules based on the characteristics of the task exception data.

[0042] Further, the exception handling strategy includes, for example: Retry, Go, Ignore, etc.; among them, before determining that the exception handling strategy is Retry, it is necessary to attempt to correct the task node exception (for example: attempt to restore the network connection, release resources, etc.); for the case where the exception handling strategy is Go, the final end program can be directly executed; for the case where the exception handling strategy is Ignore, the next one or more task nodes of the current task node can be determined through the configuration information, and by ignoring the exception of this task node, the subsequent nodes can be continued to be executed.

[0043] Further, the task running thread is used to handle the task exception based on the received exception handling strategy. For example: execute exception handling strategies such as Retry, Go, or Ignore for the currently abnormal task node.

[0044] Through the data interaction among the exception handling thread, the task running thread, and the exception handling module in steps S101 to S103, when an exception occurs in the task node, the operations of suspending and handling the abnormal task node can be executed, improving the real-time performance and efficiency of handling the task node exception, and improving the reliability of handling the task node exception; it can automatically record the context of the exception, use the batch scheduling system to control the task process, reduce the complexity of control, and there is no need to additionally consider the logic of blocking the subsequent task process when an exception occurs in the task node; and when handling the exception, there is no need to restart the task execution thread, improving the response efficiency.

[0045] As Figure 2 shown, an embodiment of the present invention provides an interaction process for handling task exceptions, and this process may include the following steps: Among them, steps S201 to S206 are executed by using a task running thread: Step S201: It is detected that there is an exception in the task node being executed.

[0046] Step S202: Write the task exception data corresponding to the task node into the task log data source.

[0047] Step S203: Send the task exception data corresponding to the task node to the exception handling thread.

[0048] Step S204: Obtain the receiving end of the exception handling pipeline sent by the exception handling thread.

[0049] Step S205: Wait at the receiving end of the exception handling pipeline to receive the exception handling strategy (sent by the exception handling thread using the sending end of the target exception handling pipeline).

[0050] Step S206: Handle the task exception based on the exception handling strategy.

[0051] Among them, steps S207 to S212 are executed by using the exception handling thread: Step S207: Receive the task exception data of the task node and construct a corresponding exception handling pipeline for the task node.

[0052] Step S208: Bind the task exception data to the exception handling pipeline.

[0053] Step S209: Send the receiving end of the exception handling pipeline to the task running thread.

[0054] Step S210: Receive the exception handling strategy for the task exception data sent by the exception handling module, and obtain the task node feature value included in the task exception data.

[0055] Step S211: Search for the target exception handling pipeline bound to the task node feature value.

[0056] Step S212: Use the sending end of the target exception handling pipeline to send the exception handling strategy to the task running thread.

[0057] Specifically, the exception handling thread can construct and maintain multiple exception handling pipelines, and different exception handling pipelines are distinguished by task node eigenvalue. It can be understood that a task node may have multiple exceptions, so a task node can correspond to multiple exception handling pipelines (each exception handling pipeline is distinguished by the task node identifier combined with the exception occurrence timestamp). When the exception handling thread receives the exception handling strategy for the task exception data sent by the exception handling module, it first searches for the matching target exception handling pipeline through the task node eigenvalue included in the task exception data. Further, it uses the sending end of the target exception handling pipeline to send the exception handling strategy to the task running thread. That is, before binding the task exception data to the exception handling pipeline corresponding to the task node by using the exception handling thread, it further includes: after receiving the task exception data by using the exception handling thread, obtaining the task node exception eigenvalue included in the task exception data; constructing the corresponding exception handling pipeline for the task node based on the task node exception eigenvalue.

[0058] Further, the steps S213 to S214 executed by the exception handling module are as follows: Step S213: Obtain the task exception data of the task node from the task log data source.

[0059] Step S214: Send the exception handling strategy for the task exception data.

[0060] Steps S201 to S214 describe the interaction timing and the content of data interaction among the task running thread, the exception handling thread, and the exception handling module. That is, use the task running thread to execute one or more task nodes; in the case of detecting an exception in the currently executing task node, send the task exception data corresponding to the task node to the exception handling thread; use the exception handling thread to bind the task exception data to the exception handling pipeline corresponding to the task node, and return the receiving end of the exception handling pipeline to the task running thread; use the task running thread to receive the exception handling strategy for the task exception data via the receiving end of the exception handling pipeline; use the task running thread to process the task exception based on the exception handling strategy.

[0061] Further, after receiving the task exception data, the exception handling thread obtains the task node exception eigenvalue included in the task exception data; constructs the corresponding exception handling pipeline for the task node based on the task node exception eigenvalue.

[0062] The task running thread writes the task exception data corresponding to the task node into the task log data source.

[0063] Use the exception handling module to obtain the task exception data from the task log data source, and determine the exception handling strategy for the task node based on the task exception data.

[0064] As shown Figure 3 in the figure, an embodiment of the present invention provides a method for handling task exceptions. The method may include the following steps: Step S301: Use a task running thread to execute one or more task nodes; when it is detected that an exception exists in the currently executing task node, use the task running thread to connect to an exception handling service port, and through the exception recording service provided by the exception handling service port, send the task exception data corresponding to the task node to an exception handling thread.

[0065] Step S302: Use the exception handling thread to bind the task exception data to an exception handling pipeline corresponding to the task node, and return the receiving end of the exception handling pipeline to the task running thread.

[0066] Step S303: Use the task running thread to receive an exception handling policy for the task exception data via the receiving end of the exception handling pipeline; wherein, use an exception handling module to connect to the exception handling service port, and through the exception handling service provided by the exception handling service port, send an exception handling policy for the task node to the exception handling thread.

[0067] Step S304: Use the task running thread to handle the task exception based on the exception handling policy.

[0068] In an embodiment of the present invention, an exception handling service port is provided. The exception service port provides different service types (such as an exception recording service, an exception handling service, etc.). The task running thread sends the task exception data corresponding to the task node to the exception handling thread through the exception recording service of the exception service port; the exception handling module sends an exception handling policy for the task node to the exception handling thread through the exception handling service provided by the exception handling service port.

[0069] That is, an exception handling service port is set; sending the task exception data corresponding to the task node to the exception handling thread includes: using the task running thread to connect to the exception handling service port, and through the exception recording service provided by the exception handling service port, sending the task exception data corresponding to the task node to the exception handling thread.

[0070] After using the exception handling module to obtain task exception data from a task log data source and determining an exception handling policy for the task node based on the task exception data, it further includes: using the exception handling module to connect to the exception handling service port, and through the exception handling service provided by the exception handling service port, sending an exception handling policy for the task node to the exception handling thread.

[0071] By setting an exception handling service port and enabling different service types of the exception handling service port to transmit different data between the task running thread and the exception handling thread, and between the exception handling thread and the exception handling module, the efficiency and reliability of handling task exceptions are further improved.

[0072] In an embodiment of the present invention, the exception handling thread and the task running thread may belong to a batch processing scheduling system. For example, the exception handling thread is started by the batch processing scheduling system, and the exception handling service port is monitored to receive the exception data of the task node sent by the task running thread via the exception handling service port; the batch processing scheduling system also starts a number of task running threads according to a preset batch processing task process to execute one or more task nodes (i.e., call an application program).

[0073] As Figure 4 shown, an embodiment of the present invention provides a device 400 for handling task exceptions, including: a detection exception module 401, a binding pipeline module 402, and a processing exception module 403; wherein, The detection exception module 401 is configured to execute one or more task nodes by using the task running thread; when it is detected that an exception exists in the currently executing task node, the task exception data corresponding to the task node is sent to the exception handling thread; The binding pipeline module 402 is configured to bind the task exception data to the exception handling pipeline corresponding to the task node by using the exception handling thread, and return the receiving end of the exception handling pipeline to the task running thread; The processing exception module 403 is configured to receive the exception handling policy for the task exception data via the receiving end of the exception handling pipeline by using the task running thread, and handle the task exception based on the exception handling policy.

[0074] An embodiment of the present invention also provides an electronic device for handling task exceptions, including: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in any of the above embodiments.

[0075] An embodiment of the present invention also provides a computer-readable medium, on which a computer program is stored, and when the program is executed by a processor, the method provided in any of the above embodiments is implemented.

[0076] An embodiment of the present invention also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the method for handling task exceptions as described above is implemented.

[0077] Figure 5An exemplary system architecture 500 for a method or apparatus for handling task exceptions to which embodiments of the present invention can be applied is shown.

[0078] As Figure 5 shown, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 is used to provide a medium for communication links between the terminal devices 501, 502, 503 and the server 505. The network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.

[0079] Users can use the terminal devices 501, 502, 503 to interact with the server 505 through the network 504 to receive or send messages, etc. Various client applications may be installed on the terminal devices 501, 502, 503, such as e-commerce client applications, web browser applications, search applications, instant messaging tools, and email clients, etc.

[0080] The terminal devices 501, 502, 503 may be various electronic devices having a display screen and supporting various client applications, including but not limited to smartphones, tablets, laptop portable computers, and desktop computers, etc.

[0081] The server 505 may be a server that provides various services, such as a background management server that supports the client applications used by users with the terminal devices 501, 502, 503. The background management server may process requests for detection task node operation data received and feedback the detection results of the detection task node operation data to the terminal devices.

[0082] It should be noted that the method for handling task exceptions provided by the embodiments of the present invention is generally executed by the server 505. Correspondingly, the apparatus for handling task exceptions is generally disposed in the server 505.

[0083] It should be understood that Figure 5 the numbers of terminal devices, networks, and servers in

[0084] are merely illustrative. According to actual needs, there may be any number of terminal devices, networks, and servers. Figure 6 is a schematic structural diagram of a computer system 600 of a terminal device suitable for implementing embodiments of the present invention. Figure 6 The terminal device shown is merely an example and should not impose any limitations on the functions and usage scope of the embodiments of the present invention.

[0085] As Figure 6As shown, computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage section 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0086] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is mounted on the drive 610 as needed so that a computer program read therefrom can be installed into the storage section 608 as needed.

[0087] Specifically, according to an embodiment disclosed by the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment disclosed by the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program codes for performing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 609, and / or installed from the removable medium 611. When the computer program is executed by a central processing unit (CPU) 601, the above functions defined in the system of the present invention are executed.

[0088] It should be noted that the computer-readable medium shown in the present invention can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, the computer-readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, in which computer-readable program code is carried. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and the computer-readable medium can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0089] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code, and the above module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks can occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0090] The modules and / or units involved in the embodiments of the present invention can be implemented in software or in hardware. The described modules and / or units can also be provided in a processor. For example, it can be described as: a processor includes an anomaly detection module, a binding pipeline module, and an anomaly handling module. Among them, the names of these modules do not constitute a limitation on the modules themselves in some cases. For example, the anomaly detection module can also be described as "a module that uses a task running thread to detect the running status of one or more task nodes in a task process".

[0091] As another aspect, the present invention also provides a computer-readable medium. This computer-readable medium can be included in the device described in the above embodiments; or it can exist alone without being assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by the device, the device includes: when it can use a task running thread to detect that there is an anomaly in the task node being executed, sending the task anomaly data corresponding to the task node to the task running thread; using an anomaly handling thread to bind the task anomaly data to an anomaly handling pipeline and returning the receiving end of the anomaly handling pipeline to the task running thread; using the task running thread to receive an anomaly handling policy for the task anomaly data via the receiving end of the anomaly handling pipeline and handling the task anomaly based on the anomaly handling policy. The embodiments of the present invention complete anomaly handling through data interaction among the task running thread, the anomaly handling thread, and the anomaly handling module, improving the flexibility, efficiency, and reliability of anomaly handling.

[0092] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for handling task exceptions, characterized in that, including: executing one or more task nodes by using a task running thread; when detecting an exception in the currently executing task node, sending task exception data corresponding to the task node to an exception handling thread; using the exception handling thread to bind the task exception data to an exception handling pipeline corresponding to the task node, and returning a receiving end of the exception handling pipeline to the task running thread; using the task running thread to receive, via the receiving end of the exception handling pipeline, an exception handling policy for the task exception data, and handling the task exception based on the exception handling policy.

2. The method according to claim 1, wherein: before using the exception handling thread to bind the task exception data to the exception handling pipeline corresponding to the task node, further comprising: using the exception handling thread to receive the task exception data, and obtaining a task node exception feature value included in the task exception data; constructing, based on the task node exception feature value, a corresponding exception handling pipeline for the task node.

3. The method according to claim 1, wherein: when detecting an exception in the currently executing task node, further comprising: writing the task exception data corresponding to the task node into a task log data source; so that the exception handling module can obtain the task exception data from the task log data source.

4. The method according to claim 1, characterized in that further comprising: using the exception handling thread to receive an exception handling policy for the task exception data sent by the exception handling module; sending the received exception handling policy to the task running thread.

5. The method according to claim 4, wherein: using the exception handling thread to receive the exception handling policy for the task exception data sent by the exception handling module further comprises: obtaining the task node exception feature value included in the task exception data; searching, from a plurality of exception handling pipelines, for a target exception handling pipeline bound to the task node exception feature value; sending the received exception handling policy to the task running thread comprises: using a sending end of the target exception handling pipeline to send the exception handling policy to the task running thread.

6. The method according to claim 1, wherein further comprising: an exception handling service port is provided; sending the task exception data corresponding to the task node to the exception handling thread comprises: using the task running thread to connect to the exception handling service port, and sending, through an exception recording service provided by the exception handling service port, the task exception data corresponding to the task node to the exception handling thread.

7. The method according to claim 3, characterized in that, further comprising: an exception handling service port is provided; after using the exception handling module to obtain the task exception data from the task log data source, further comprising: using the exception handling module to connect to the exception handling service port, and sending, through an exception handling service provided by the exception handling service port, an exception handling policy for the task node to the exception handling thread.

8. A device for processing task exceptions, characterized in that, including: An exception detection module, a binding pipeline module, and an exception handling module; wherein, the exception detection module is configured to execute one or more task nodes by using a task running thread; when an exception in a currently executing task node is detected, send task exception data corresponding to the task node to an exception handling thread; the binding pipeline module is configured to bind the task exception data to an exception handling pipeline corresponding to the task node by using the exception handling thread, and return a receiving end of the exception handling pipeline to the task running thread; the exception handling module is configured to receive, by using the task running thread, an exception handling strategy for the task exception data via the receiving end of the exception handling pipeline, and handle the task exception based on the exception handling strategy.

9. An electronic device, characterized in that, Comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enabling the one or more processors to implement the method according to any one of claims 1-7.

10. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the method according to any one of claims 1-7.

11. A computer program product, comprising a computer program, characterized in that, When the program is executed by a processor, it implements the method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Structured exception handling for application-managed thread units

    CN101251792A

  • AI algorithm offline scheduling method and system, computer equipment and storage medium

    CN113641482A

  • Process data processing method, terminal equipment and storage medium

    CN116204289A

  • Item processing exception configurable pipeline

    US20180365018A1