Asynchronous task execution method, device, equipment and storage medium

Through the method of generating and encapsulating call error information, the problem of being unable to directly obtain error description information when proxying asynchronous tasks is solved, the error link can be quickly located, and the efficiency of error handling is improved.

CN110908820BActive Publication Date: 2024-09-06BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201911076087.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-11-06
Publication Date
2024-09-06
Estimated Expiration
2039-11-06

AI Technical Summary

Technical Problem

When using a proxy mechanism to proxy an asynchronous task, the error description information cannot be obtained directly during the process of capturing calling errors, making error analysis cumbersome and inconvenient.

Method used

By generating call error information, encapsulating it as an error description object, and displaying the error information through the error handling function, including error description information and proxy object information, the error link is directly clarified.

Benefits of technology

The time of error analysis is reduced, the error link in the process of calling the proxy object is clearly known, and the efficiency of error handling is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110908820B
    Figure CN110908820B
Patent Text Reader

Abstract

The present disclosure provides an asynchronous task execution method, device, equipment and storage medium, which relates to the field of computer technology and is used to optimize the process of capturing call error information when a proxy object proxies an asynchronous task. The method comprises: in the process of calling at least one proxy object, if a call error occurs and the error description information of this call error is determined from the historical error information, a first call error information is generated, wherein the first call error information includes the error description information and the object information of the proxy object of this call error; the first call error information is encapsulated into a first error description object, and the first error description object is used as a parameter of a first error handling function; the first error handling function is loaded through a second error handling function to display the first call error information. When an error occurs in calling a proxy object, the method can directly display the error description information and object information of the call error, thereby reducing the time for analyzing the error.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to an asynchronous task execution method, device, equipment and storage medium. Background Art

[0002] In the related art, when a proxy mechanism is used to proxy asynchronous tasks, an error may occur in the process of calling the proxy object. Currently, an exception capture .catch() function is often added at the end of the proxy object chain. The .catch() function captures errors thrown in the process of calling the proxy object, but the error description information of the call error cannot be directly obtained from the error captured by the .catch() function. The staff can only analyze the captured error again to obtain the error description information of the call proxy object, and then find out the link where the error occurred in the process of calling the proxy object. The process of analyzing and executing asynchronous tasks with errors is cumbersome and inconvenient. Summary of the invention

[0003] The embodiments of the present disclosure provide an asynchronous task execution method, apparatus, device and storage medium for optimizing the process of capturing call error information when a proxy object proxies an asynchronous task.

[0004] In a first aspect, the present disclosure provides a method for executing an asynchronous task, comprising:

[0005] In the process of calling at least one proxy object, if a call error occurs and error description information of the current call error is determined from historical error information, first call error information is generated, wherein the proxy object proxies at least one asynchronous task, and the first call error information includes error description information of the current call error and object information of the proxy object of the current call error;

[0006] Encapsulate the first call error information into a first error description object, and use the first error description object as a parameter of a first error handling function;

[0007] The first error handling function is loaded through the second error handling function to display the first calling error information of the first error description object.

[0008] In a possible implementation, the method further includes:

[0009] If the call is wrong and the error description information of the current call error is not determined from the historical error information, determining the second call error information for prompting the call error;

[0010] Encapsulating the second call error information into a second error description object, and using the second error description object as a parameter of the first error handling function;

[0011] The first error handling function is loaded through the second error handling function to display the second calling error information of the second error description object.

[0012] In a possible implementation, the step of determining error description information of the current call error from historical error information includes:

[0013] Determine the error identifier of this call error;

[0014] Determine the error description information corresponding to the error identifier in the historical error information as the error description information of the current call error.

[0015] In a possible implementation, the step of encapsulating the first call error information into a first error description object includes:

[0016] The first call error information is encapsulated into the first error description object according to a preset encapsulation structure.

[0017] In a possible implementation, the preset encapsulation format includes an error object attribute and an error description attribute, and the step of encapsulating the first call error information into the first error description object according to the preset encapsulation format includes:

[0018] The object information of the proxy object of the current call error is used as the object attribute value of the error object attribute, and the error description information of the current call error is used as the description attribute value of the error description attribute to encapsulate the first error description object.

[0019] In a possible implementation, the step of encapsulating the first call error information into a first error description object further includes:

[0020] Determine additional error description information of the current call error, wherein the additional error description information includes one or more information of the write log information, the time of the call error, the operator of the current call error, and the operating system of the current call error;

[0021] The additional error description information is encapsulated in the first error description object.

[0022] According to a second aspect of the present disclosure, there is provided an asynchronous task execution device, comprising:

[0023] A call error information determination unit is configured to generate first call error information if a call error occurs and error description information of the current call error is determined from historical error information during the process of calling at least one proxy object, wherein the one proxy object proxies at least one asynchronous task, and the first call error information includes error description information of the current call error and object information of the proxy object of the current call error;

[0024] an error description object encapsulation unit, configured to encapsulate the first call error information into a first error description object, and use the first error description object as a parameter of a first error handling function;

[0025] The error information display unit is configured to load the first error processing function through the second error processing function to display the first calling error information of the first error description object.

[0026] In a possible implementation, the call error information determination unit is further configured to determine second call error information for prompting a call error if a call error occurs and error description information of the current call error is not determined from the historical error information;

[0027] The error description object encapsulation unit is further configured to encapsulate the second call error information into a second error description object, and use the second error description object as a parameter of the first error handling function;

[0028] The error information display unit is further configured to execute the second error handling function by loading the first error handling function to display the second calling error information of the second error description object.

[0029] In a possible implementation, the calling error information determination unit is specifically configured to execute:

[0030] Determine the error identifier of this call error;

[0031] Determine the error description information corresponding to the error identifier in the historical error information as the error description information of the current call error.

[0032] In a possible implementation, the error description object encapsulation unit is specifically configured to execute:

[0033] The first call error information is encapsulated into the first error description object according to a preset encapsulation structure.

[0034] In a possible implementation, the preset encapsulation format includes an error object attribute and an error description attribute, and the error description object encapsulation unit is specifically configured to execute:

[0035] The object information of the proxy object of the current call error is used as the object attribute value of the error object attribute, and the error description information of the current call error is used as the description attribute value of the error description attribute to encapsulate the first error description object.

[0036] In a possible implementation, the error description object encapsulation unit is further configured to execute:

[0037] Determine additional error description information of the current call error, wherein the additional error description information includes one or more information of the write log information, the time of the call error, the operator of the current call error, and the operating system of the current call error;

[0038] The additional error description information is encapsulated in the first error description object.

[0039] According to a third aspect of the present disclosure, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the first aspect and any one of the possible implementation modes is implemented.

[0040] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions. When the computer instructions are executed on a computer, the computer executes the method described in the first aspect and any one of the possible implementation modes.

[0041] The solution disclosed herein brings at least the following beneficial effects:

[0042] In the scheme disclosed in the present invention, when an error occurs in calling a proxy object, the error description information of the calling error and the object information of the proxy object that called the error are encapsulated into a first error description object. The error description information and object information in the first error description object are directly displayed through a second error function, so that the error link in the process of calling the proxy object can be clearly known, reducing the time for error analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0044] Figure 1 A complete flowchart of an asynchronous task execution provided by an exemplary embodiment of the present disclosure;

[0045] Figure 2A schematic diagram of the structure of an asynchronous task execution device provided by an exemplary embodiment of the present disclosure;

[0046] Figure 3 A schematic structural diagram of an electronic device provided by an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

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

[0048] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein.

[0049] In order to help those skilled in the art better understand the technical solutions of the present disclosure, the technical terms involved in the present disclosure are explained below.

[0050] Asynchronous task: A task that is executed asynchronously. Asynchronous task refers to a task that is put aside by the engine and enters the task queue instead of the main process. Only when the engine considers that an asynchronous task can be executed, the asynchronous task (in the form of a callback function) will enter the main thread for execution. The program behind the asynchronous task will run immediately without waiting for the asynchronous task to end. Asynchronous task is relative to synchronous task. Synchronous task refers to a task that is not suspended by the engine and is queued for execution on the main thread. The next task can only be executed after the previous task is completed, which may cause a "blocking" effect. Among them, task is a user-defined function in software development, which is used to implement user functions.

[0051] Promise proxy mechanism: It is an API newly added to the ES6 standard, which aims to solve the callback problem of asynchronous tasks and is widely used. Writing with Promise will also improve the readability and maintainability of the program. When using Promise, each function call does not need to know where the next execution program should go to, and the execution order is completely decided by the caller.

[0052] The design concept of the present disclosure is described below.

[0053] There are a large number of asynchronous tasks in the Node Server. Each asynchronous task has one or more callback functions. After the previous IBU task is completed, the callback function is executed instead of the next asynchronous task. The next asynchronous task is executed without waiting for the previous asynchronous task to be completed. Therefore, the execution order of the program is not synchronized with the arrangement order of the asynchronous tasks. However, there will be a callback hell problem when processing asynchronous tasks. In order to avoid this problem, the proxy mechanism is used in the project to process asynchronous tasks.

[0054] For example, in the Promise proxy mechanism, the Promise chain call processing needs to execute multiple asynchronous tasks in sequence. In order to capture the error information in the Promise chain call, an exception capture function .catch() is often added at the end of the Promise chain to capture the error information in the Promise chain call. However, .catch() can only receive error parameters of a specified type by default. The error parameters contain the basic error information in the Promise chain call. The error parameters need to be re-analyzed to obtain the asynchronous task that has executed the error, which is very inconvenient and cannot accurately obtain the link where the error occurred.

[0055] In view of this, the present invention designs an execution method, device, equipment and storage medium of an asynchronous task to optimize the process of capturing call error information when a proxy object proxies an asynchronous task. The method of the present invention includes: using a proxy object to proxy an asynchronous task, and in the process of calling at least one proxy object, if a call error occurs, determining the information of this call error based on historical error information, and if error description information of this call error is determined from the historical error information, generating first call error information, the above-mentioned first call error information includes the error description information of this call error and the object information of the proxy object of this call error; then encapsulating the first call error information into a first error description object, and using the first error description object as a parameter of a first error handling function; loading the above-mentioned first error handling function through a second error handling function to display the first call error information of the above-mentioned first error description object.

[0056] The solution of the present disclosure is described in detail below with reference to the accompanying drawings.

[0057] When multiple asynchronous tasks need to be scheduled, one or more proxy objects are used to proxy the asynchronous tasks, wherein one proxy object can proxy one or more asynchronous tasks. In this embodiment, only one proxy object is used to proxy one asynchronous task for illustration.

[0058] Multiple proxy objects form a proxy chain in the scheduling order determined by the scheduler. After a proxy object on the proxy chain is successfully called, the next proxy object can be called. Once a proxy object is called incorrectly, that is, when the call to a proxy object fails, the execution of the proxy chain ends.

[0059] In this embodiment, only the Promise object in the Promise proxy mechanism is used as the above-mentioned proxy object to describe the scheme of the present disclosure in detail, but it should be understood that the scheme in the present disclosure is not limited to use in the Promise proxy mechanism, and can also be used in other task proxy mechanisms.

[0060] A Promise object can have the following states:

[0061] 1) Initial state pending: the state when the Promise object has not been called, which is neither a successful call nor a call error;

[0062] 2) Call successfully filled: refers to the completion status of calling the Promise object operation, that is, the call is successful;

[0063] 3) Call error reject: refers to the failure state of calling the Promise object operation, that is, the call error.

[0064] In order to achieve the purpose of displaying the call error information, the present disclosure sets an error capture function, a first error handling function and a second error handling function in the main thread, wherein:

[0065] In the process of calling at least one proxy object, if the call occurs in error, the error capture function is executed, the call error information is captured by the error capture function, and the call error information is encapsulated into an error description object, and the error description object is used as a parameter of the first error handling function; then the first error handling function is loaded through the second error handling function, and the call error information in the error description object is displayed.

[0066] The following is a detailed description of the structure of the above error capture function:

[0067] The above error capture function is provided with an error information capture program module and an error description object encapsulation program module, as follows:

[0068] 1) Error information capture program module

[0069] Search for error information related to the current call error from historical error information. If the error description information of the current call error is determined in the historical error information, generate the first call error information; wherein the first call error information includes the error description information of the current call error and the object information of the proxy object of the current call error.

[0070] If the error description information of the current call error is not determined from the above historical error information, the second call error information automatically thrown when the call error occurs is determined. The second call error information is used to prompt the call error, but does not prompt the specific error description information and the proxy information of the proxy object of the call error.

[0071] 2) Error description object encapsulation program module

[0072] If the first call error information is generated in the error information capture program module, and if the second call error information is determined in the error information capture program module, the second call error information is encapsulated into a second error description object.

[0073] Furthermore, the first error description object and the second error description object can be encapsulated by the following method:

[0074] The above-mentioned first call error information can be encapsulated into the above-mentioned first error description object according to a preset encapsulation structure; when the above-mentioned preset encapsulation format includes attributes such as error object attribute err and error description attribute msg, the object information of the proxy object of the above-mentioned call error can be used as the object attribute value of the above-mentioned error object attribute, and the error description information of the above-mentioned call error can be encapsulated as the description attribute value of the above-mentioned error description attribute to obtain the above-mentioned first error description object.

[0075] Optionally, the reject() function in the Promise proxy mechanism can be optimized to obtain the above-mentioned error capture function. Specifically, reject(err) in the reject() function can be optimized to reject({err:Err, msg:XXX}), wherein err represents the above-mentioned error object attribute, Err represents the object attribute value of the above-mentioned error object attribute, the above-mentioned msg represents the above-mentioned error description attribute, and the above-mentioned XXX represents the description attribute value of the error description attribute.

[0076] When encapsulating the first error description object, the object information of the proxy object of this call error can be used as the above-mentioned object attribute value Err to indicate the proxy object of this call error, and the error description information determined from the historical error information can be used as the above-mentioned description attribute value XXX to indicate the specific description information of this call error.

[0077] When encapsulating the second error description object, the second call error information is used as the attribute value of the attribute of the second error description object to generate a second error object that does not contain the error description information XXX.

[0078] The above object information is used to represent the identity of the proxy object, and can be, but not limited to, using numbers or other set format characters to set an object information for each proxy object.

[0079] The following is a detailed description of the steps to find the error information related to the current call error from the historical error information:

[0080] Determine the error identifier of this call error;

[0081] Determine the error description information corresponding to the above error identifier in the historical error information as the error description information of the current call error.

[0082] Among them, the above historical error information can save the mapping relationship between the error description information and error identifier of previous call errors. When an error occurs when calling a proxy object, the error identifier of this call error can be determined, and then the error description information corresponding to the error identifier can be queried from the historical error information.

[0083] The above-mentioned call errors may include information input errors, third-party service errors, database operation errors, etc. The above-mentioned error description information may be information input errors, XX service errors, database query data errors, data addition errors, data deletion errors, etc.

[0084] The above error identifier is only used to identify the call error event, and a number or a set format character can be used as the above error identifier.

[0085] The following is a mapping relationship between error description information and error identifiers, see Table 1:

[0086] Table 1:

[0087] Error identification Error description information 1000 Information input error 1001 XX service error 1010 Database query data error 1011 Data deletion error … …

[0088] In Table 1, binary numbers are used to represent error identifiers. Those skilled in the art may also use other forms to identify error identifiers, wherein each error identifier corresponds to an error description information.

[0089] Optionally, the .catch() function in the Promise proxy mechanism can be optimized to obtain the above-mentioned second error handling function. Specifically, .catch(err=>handleError(err)) in the .catch() function can be optimized to .catch(catchError(({err,msg})=>handleError(err,msg))), so that the obtained second error handling function can handle the first error description object and the second error description object.

[0090] The second error handling function loads the first error handling function. If the parameter of the first error handling function is the first error description object, the first call error information in the first error description object is displayed, that is, the error description information and object information in the first call error information are displayed to inform the user or technician of the specific error link and cause in the process of calling the proxy object; if the parameter of the first error handling function is the second description object, the second call error information in the second error description object is displayed to indicate the call error to the user or developer, allowing them to analyze the second call error information to obtain the specific error link and cause in the process of calling the proxy object.

[0091] In order to display more detailed call error information, the present disclosure can also determine the attached error description information of this call error when encapsulating the first call error information into the first error description object, and encapsulate the above-mentioned additional error description information in the above-mentioned first error description information; the above-mentioned additional error description information may include writing log information, the time of the call error, the operator of this call error and one or more information of the operating system of this call error.

[0092] You can also add the log keyword log when encapsulating the first error description object in the reject({err:err, msg:XXX}) format, that is, encapsulate the first error description object in the form of reject({err:err, msg:XXX, log:YYY}), where YYY is additional error description information that writes the first call error information into the log.

[0093] Correspondingly, the program .catch(catchError(({err, msg})=>handleError(err, msg))) in the second error handling function can be optimized as follows:

[0094]

[0095] The above program indicates that if the log keyword log exists, the YYY information corresponding to the log keyword log is written into the log file.

[0096] like Figure 1 As shown, for ease of understanding, a complete process of the disclosed solution is given, which specifically includes:

[0097] In the process of calling at least one proxy object, when any proxy object is called, the process goes to step S101.

[0098] Step S101, determine whether an error occurs in the call, if an error occurs, go to step S102, if the call is successful, go to step S109.

[0099] Step S102: Determine error description information of the current call error from historical error information.

[0100] Step S103, judging whether the error description information of the current call error is determined from the historical error information, if it is determined, proceeding to step S104, otherwise, proceeding to step S105.

[0101] Step S104, taking the error description information of the calling error and the object information of the proxy object of the calling error as the first calling error information, and encapsulating the first calling error information into an error description object, and proceeding to step S106.

[0102] In this step, the error description object encapsulated by the first call error information is the first error description object.

[0103] Step S105, determining the second call error information for prompting the call error, and proceeding to step S106.

[0104] Step S106, determine whether the error description object contains attributes, if so, go to step S107, otherwise, go to step S1061.

[0105] The error description object encapsulated in step S104 according to the above reject ({err:err, msg:XXX}) format has the attributes err and msg, while step S105 only determines the second call error information and does not contain any attributes.

[0106] Step S1061, encapsulate the second call error information as an attribute to obtain an error description object, and proceed to step S107.

[0107] In this step, the error description object encapsulated by the second call error information is the second error description object.

[0108] Step S107: Use the error description object as a parameter of the first error handling function.

[0109] Step S108, loading the first error handling function through the second error handling function, and displaying the calling error information.

[0110] If the parameter of the first error handling function is the first error description object, the first call error information is displayed in the step; if the parameter of the first error handling function is the second error description object, the second call error information is displayed in the step.

[0111] Step S109, call the next proxy object and go to step S101.

[0112] For ease of understanding, the implementation effects of the disclosed solution are given below for illustration.

[0113] The target task of this example scenario is to query user information in batches. This target task includes the following three asynchronous task links:

[0114] The first asynchronous task: upload files;

[0115] The second asynchronous task: read the file;

[0116] The third asynchronous task: Get the user's identity.

[0117] The first proxy object is used to proxy the first asynchronous task, the second proxy object is used to proxy the second asynchronous task, and the third proxy object is used to proxy the third asynchronous task. The first proxy object to the third proxy object form a proxy chain, which includes three links. Any call error of any proxy object will cause the target task to fail.

[0118] If an error occurs when calling the first proxy object, an error description message is provided as "Error in uploading file, reason is XX"; if an error occurs when calling the second proxy object, an error description message is provided as "Error in reading file, reason is YY"; if an error occurs when calling the third proxy object, an error description message is provided as "Error in third-party service, reason is ZZ".

[0119] Then, the second error handling function in the proxy mechanism can capture and display the above-mentioned error description information, so that users or technicians can quickly locate the error link and make repairs in time.

[0120] In the present disclosure, the calling error information is encapsulated into an error description object, and the error description object is used as a parameter of the first error handling function. The first error handling function is loaded through the second error handling function, and the error description information in the error description object and the object information of the proxy object of the calling error can be directly displayed, so that users or technicians can more conveniently know the specific links and causes of the errors in the process of calling at least one proxy object; and the error description information can be expanded to obtain more description information of the calling error.

[0121] like Figure 2 As shown, based on the same inventive concept, the embodiment of the present disclosure also provides an asynchronous task execution device 200, the device comprising:

[0122] The call error information determination unit 201 is configured to generate first call error information if a call error occurs and error description information of the current call error is determined from historical error information during the process of calling at least one proxy object, wherein the one proxy object proxies at least one asynchronous task, and the first call error information includes error description information of the current call error and object information of the proxy object of the current call error;

[0123] The error description object encapsulation unit 202 is configured to encapsulate the first call error information into a first error description object, and use the first error description object as a parameter of a first error processing function;

[0124] The error information display unit 203 is configured to load the first error processing function through the second error processing function to display the first calling error information of the first error description object.

[0125] Optionally, the call error information determination unit is further configured to determine second call error information for prompting the call error if the call is erroneous and the error description information of the current call error is not determined from the historical error information;

[0126] The error description object encapsulation unit is further configured to encapsulate the second call error information into a second error description object, and use the second error description object as a parameter of the first error handling function;

[0127] The error information display unit is further configured to execute the second error handling function by loading the first error handling function to display the second calling error information of the second error description object.

[0128] Optionally, the call error information determining unit is further configured to execute:

[0129] Determine the error identifier of this call error;

[0130] Determine the error description information corresponding to the error identifier in the historical error information as the error description information of the current call error.

[0131] Optionally, the error description object encapsulation unit is specifically configured to execute:

[0132] The first call error information is encapsulated into the first error description object according to a preset encapsulation structure.

[0133] Optionally, the preset encapsulation format includes an error object attribute and an error description attribute, and the error description object encapsulation unit is specifically configured to execute:

[0134] The object information of the proxy object of the above-mentioned call error is used as the object attribute value of the above-mentioned error object attribute, and the error description information of the above-mentioned call error is used as the description attribute value of the above-mentioned error description attribute to encapsulate the above-mentioned first error description object.

[0135] Optionally, the error description object encapsulation unit is further configured to execute:

[0136] Determine additional error description information of the current call error, the additional error description information including one or more information of the write log information, the time of the call error, the operator of the current call error, and the operating system of the current call error;

[0137] The additional error description information is encapsulated in the first error description object.

[0138] like Figure 3 As shown, the present disclosure provides an electronic device 300, including a processor 301, and a memory 302 for storing instructions executable by the processor;

[0139] The processor is configured to perform the following process:

[0140] In the process of calling at least one proxy object, if the calling error occurs and error description information of the current calling error is determined from historical error information, first calling error information is generated, wherein the above-mentioned one proxy object proxies at least one asynchronous task, and the above-mentioned first calling error information includes error description information of the current calling error and object information of the proxy object of the current calling error;

[0141] Encapsulate the first call error information into a first error description object, and use the first error description object as a parameter of a first error handling function;

[0142] The first error handling function is loaded through the second error handling function to display the first calling error information of the first error description object.

[0143] The processor is further configured to perform the following process:

[0144] If the call is wrong and the error description information of the current call error is not determined from the above historical error information, then second call error information for prompting the call error is determined;

[0145] Encapsulate the second call error information into a second error description object, and use the second error description object as a parameter of the first error handling function;

[0146] The second error handling function loads the first error handling function to display the second calling error information of the second error description object.

[0147] The processor is specifically configured to perform the following process:

[0148] Determine the error identifier of this call error;

[0149] Determine the error description information corresponding to the error identifier in the historical error information as the error description information of the current call error.

[0150] The processor is specifically configured to perform the following process:

[0151] The first call error information is encapsulated into the first error description object according to a preset encapsulation structure.

[0152] The preset encapsulation format includes an error object attribute and an error description attribute. The processor is specifically configured to perform the following process:

[0153] The object information of the proxy object of the above-mentioned call error is used as the object attribute value of the above-mentioned error object attribute, and the error description information of the above-mentioned call error is used as the description attribute value of the above-mentioned error description attribute to encapsulate the above-mentioned first error description object.

[0154] The processor is further configured to perform the following process:

[0155] Determine additional error description information of the current call error, the additional error description information including one or more information of the write log information, the time of the call error, the operator of the current call error, and the operating system of the current call error;

[0156] The additional error description information is encapsulated in the first error description object.

[0157] In an exemplary embodiment, a storage medium including instructions is also provided, such as a memory including instructions, and the instructions can be executed by a processor of the electronic device to complete the method. Optionally, the storage medium can be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0158] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0159] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A method for executing an asynchronous task, characterized in that: include: In the process of calling at least one proxy object, if the call is erroneous and error description information of the current call error is determined from historical error information, first call error information is generated, wherein the proxy object proxies at least one asynchronous task, and the first call error information includes error description information of the current call error and object information of the proxy object of the current call error; the first call error information is encapsulated into a first error description object, and the first error description object is used as a parameter of a first error handling function; Loading the first error handling function through the second error handling function to display the first calling error information of the first error description object; If the call is wrong and the error description information of the current call error is not determined from the historical error information, determining the second call error information for prompting the call error; Encapsulating the second call error information into a second error description object, and using the second error description object as a parameter of the first error handling function; The first error handling function is loaded through the second error handling function to display the second calling error information of the second error description object.

2. The method according to claim 1, characterized in that The step of determining the error description information of the current call error from the historical error information includes: Determine the error identifier of this call error; Determine the error description information corresponding to the error identifier in the historical error information as the error description information of the current call error.

3. The method according to claim 1, characterized in that The step of encapsulating the first call error information into a first error description object comprises: The first call error information is encapsulated into the first error description object according to a preset encapsulation structure.

4. The method according to claim 3, characterized in that The preset encapsulation structure includes an error object attribute and an error description attribute. The step of encapsulating the first call error information into the first error description object according to the preset encapsulation structure includes: The object information of the proxy object of the current call error is used as the object attribute value of the error object attribute, and the error description information of the current call error is used as the description attribute value of the error description attribute to encapsulate the first error description object.

5. The method according to claim 1, characterized in that The step of encapsulating the first call error information into a first error description object further includes: Determine additional error description information of the current call error, wherein the additional error description information includes one or more information of the write log information, the time of the call error, the operator of the current call error, and the operating system of the current call error; The additional error description information is encapsulated in the first error description object.

6. An asynchronous task execution device, characterized in that: include: A call error information determination unit is configured to generate first call error information if a call error occurs and error description information of the current call error is determined from historical error information during the process of calling at least one proxy object, wherein the proxy object proxies at least one asynchronous task, and the first call error information includes error description information of the current call error and object information of the proxy object of the current call error; if a call error occurs and error description information of the current call error is not determined from the historical error information, determine second call error information for prompting a call error; an error description object encapsulation unit, configured to encapsulate the first call error information into a first error description object, and use the first error description object as a parameter of a first error handling function; Encapsulating the second call error information into a second error description object, and using the second error description object as a parameter of the first error handling function; an error information display unit, configured to load the first error handling function through a second error handling function to display the first calling error information of the first error description object; The first error handling function is loaded through the second error handling function to display the second calling error information of the second error description object.

7. The device according to claim 6, characterized in that The call error information determination unit is further configured to execute: Determine the error identifier of this call error; Determine the error description information corresponding to the error identifier in the historical error information as the error description information of the current call error.

8. The device according to claim 6, characterized in that The error description object encapsulation unit is specifically configured to execute: The first call error information is encapsulated into the first error description object according to a preset encapsulation structure.

9. The device according to claim 8, characterized in that The preset encapsulation structure includes an error object attribute and an error description attribute, and the error description object encapsulation unit is specifically configured to execute: The object information of the proxy object of the current call error is used as the object attribute value of the error object attribute, and the error description information of the current call error is used as the description attribute value of the error description attribute to encapsulate the first error description object.

10. The device according to claim 6, characterized in that The error description object encapsulation unit is further configured to execute: Determine additional error description information of the current call error, wherein the additional error description information includes one or more information of the time of the call error, the operator of the current call error, and the operating system of the current call error; The additional error description information is encapsulated in the first error description object.

11. An electronic device, characterized in that: comprising a processor, and a memory for storing instructions executable by the processor; The processor is configured to execute the method according to any one of claims 1 to 5.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed on a computer, the computer is enabled to execute the method according to any one of claims 1 to 5.