WO2020233066A1 - 基于数据计算链路的异常处理方法以及相关设备 - Google Patents

基于数据计算链路的异常处理方法以及相关设备 Download PDF

Info

Publication number
WO2020233066A1
WO2020233066A1 PCT/CN2019/121692 CN2019121692W WO2020233066A1 WO 2020233066 A1 WO2020233066 A1 WO 2020233066A1 CN 2019121692 W CN2019121692 W CN 2019121692W WO 2020233066 A1 WO2020233066 A1 WO 2020233066A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
transaction node
log
node
root cause
Prior art date
Application number
PCT/CN2019/121692
Other languages
English (en)
French (fr)
Inventor
王娟
Original Assignee
深圳壹账通智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳壹账通智能科技有限公司 filed Critical 深圳壹账通智能科技有限公司
Publication of WO2020233066A1 publication Critical patent/WO2020233066A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Definitions

  • This application relates to the field of data processing technology, and in particular to an abnormal processing method based on a data calculation link and related equipment.
  • Transaction behavior is a kind of data calculation (or data settlement) behavior.
  • the completion of a transaction usually needs to be completed by multiple teams. For example, when a user purchases a product, the transaction request will pass through Order nodes, cashier nodes, account system nodes, payment channel nodes, and bank nodes, etc., and the nodes involved above are respectively responsible for different R&D teams.
  • the transaction request is abnormal, the efficiency of locating the abnormal node and handling the abnormality is low due to the many nodes in the transaction request path.
  • This application proposes a technical solution for abnormality processing based on a data calculation link, which can improve the positioning efficiency of abnormal nodes in the data calculation link, especially the transaction link.
  • an abnormality processing method based on a data calculation link the data calculation link is specifically a transaction link, and the transaction link includes a plurality of transaction nodes; the method includes: In the case of abnormal transaction invocation on the link, the first transaction node receives the invocation information returned by the second transaction node; the invocation information includes the error codes of N transaction nodes, where N is an integer greater than 0; The transaction node is the uppermost transaction node of the transaction link; the second transaction node is the next transaction node of the first transaction node; the first transaction node obtains the The log information of each of the N transaction nodes; the first transaction node determines the root cause of the abnormal transaction call of the transaction link and the target of the root cause according to the log information of each transaction node Transaction node; the first transaction node indicates the root cause to the target transaction node, so that the target transaction node can repair the link abnormality according to the root cause.
  • the log information is standardized log information
  • the standardized log information conforms to a log standard format
  • the first transaction node determines the transaction link according to the log information of each transaction node
  • the root cause of the abnormal transaction call and the target transaction node that caused the root cause specifically include: the first transaction node matches the standardized log information according to a regular expression to determine the first target location of the root cause;
  • the first transaction node extracts the root cause of the abnormal transaction call of the transaction link according to the first target location, and determines the target transaction node that causes the root cause according to the root cause.
  • the first transaction node can comprehensively and accurately diagnose the root cause of abnormality in the transaction link according to the corresponding log information of each error code, which improves the efficiency of abnormal transaction node location and abnormality handling when an abnormality occurs in the transaction link.
  • the first transaction node matches the standardized log information according to a regular expression to determine the first target location of the root cause, including: the first transaction node matches according to the regular expression Each log segment with an error identification in the standardized log information; the content of each log segment is the reason for the occurrence of the error identification; the first transaction node converts all the logs according to the log printing time of each log segment The location of the log segment with the earliest log printing time is determined as the first target location of the root cause.
  • the regular expression is used to retrieve text that conforms to a certain pattern (rule).
  • regular expressions are used to retrieve log segments with error identifiers.
  • the error identifiers can be INFO, WARN, ERROR, FATAL, etc., thereby improving The efficiency of retrieval.
  • the solution of determining the location of the root cause according to the log printing time in this embodiment is applicable to a transaction link with only one link.
  • the first transaction node matches the standardized log information according to a regular expression to determine the first target location of the root cause, including: the first transaction node matches according to the regular expression Each log segment with an error identifier in the standardized log information; the content of each log segment is the reason for the error identifier; the first transaction node compares all log segments according to the log error level of each log segment The location of the log segment with the highest log error level is determined as the first target location of the root cause.
  • Regular expressions are used to retrieve log segments with error identifiers, where the error identifiers can be INFO, WARN, ERROR, FATAL, etc., which improves the efficiency of retrieval.
  • the solution of determining the location of the root cause according to the log error level in this embodiment is applicable to the transaction link of the multi-branch link.
  • the error code includes an identifier of the transaction node
  • the first transaction node obtains log information of each of the N transaction nodes according to the N error codes, including: The first transaction node determines, according to the identifiers of the N transaction nodes included in the N error codes, the N transaction nodes with abnormal transaction call; the first transaction node obtains from the N transaction nodes Log information related to the N error codes.
  • the first transaction node can obtain the error code of the abnormal transaction node in its downstream transaction link at one time according to the call information returned by each transaction node, and can quickly locate the abnormal transaction node according to the error code, without requiring one by one. Troubleshoot each node to improve the efficiency of locating abnormal transaction nodes.
  • the error codes of the N transaction nodes include the error codes of the second transaction node and the error codes of N-1 other transaction nodes , whereby improving the abnormal location and processing efficiency of the transaction link, avoiding to check each transaction node in the transaction link one by one.
  • the error codes of the N transaction nodes have the same data format.
  • the use of the same data format facilitates the unified processing of the error code of each transaction node in its downstream transaction link by the upstream transaction node.
  • an abnormality processing device for a data calculation link, the data calculation link is a transaction link, and the transaction link includes multiple transaction nodes; the device includes: a receiving unit and an acquiring unit , The determining unit, the indicating unit, the receiving unit is used to receive the call information returned by the second transaction node in the case of a transaction call abnormality in the transaction link; the call information includes the error codes of the N transaction nodes, so The N is an integer greater than 0; the second transaction node is the next transaction node of the first transaction node; the obtaining unit is configured to obtain the N transaction nodes according to the N error codes The log information of each transaction node; the determining unit is used to determine the root cause of the transaction call abnormality of the transaction link and the target transaction node that caused the root cause according to the log information of each transaction node; The indication unit is configured to indicate the root cause to the target transaction node, so that the target transaction node can repair the link abnormality according to the root cause.
  • the log information is standardized log information, and the standardized log information conforms to a log standard format.
  • the determining unit may further include a matching unit and an extracting unit.
  • the matching unit is used to express Formula matching the standardized log information to determine the first target location of the root cause;
  • the extraction unit is used to extract the root cause of the abnormal transaction call of the transaction link according to the first target location, and Determine the target transaction node that causes the root cause according to the root cause.
  • the matching unit is configured to match each log segment with an error identifier in the standardized log information according to the regular expression; the content of each log segment is the cause of the error identifier ; According to the log print time of each log segment, the location of the log segment with the earliest log print time is determined as the first target location of the root cause.
  • the matching unit is further configured to match each log segment with an error identifier in the standardized log information according to the regular expression; the content of each log segment is the content of the error identifier.
  • Reason According to the log error level of each log segment, the location of the log segment with the highest log error level is determined as the first target location of the root cause.
  • the error code includes the identifier of the transaction node
  • the obtaining unit is configured to determine the N transaction call abnormalities that have occurred according to the identifiers of the N transaction nodes included in the N error codes.
  • Transaction nodes obtain log information related to the N error codes from the N transaction nodes.
  • the error codes of the N transaction nodes include the error codes of the second transaction node and the error codes of N-1 other transaction nodes .
  • the error codes of the N transaction nodes have the same data format.
  • an electronic device including: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured to call the instructions stored in the memory, The invocation of the instruction causes the processor to execute the method of any one of the embodiments of the first aspect of the present application.
  • a computer-readable storage medium may be a non-volatile computer-readable storage medium, such as read-only memory (ROM), flash memory (Flash memory), etc., may also be computer readable storage media, such as random access memory (Random Access Memory, RAM).
  • the computer-readable storage medium stores a computer program, and the computer program is executed by a processor in a method according to any one of the embodiments of the first aspect of the present application.
  • the first transaction node can obtain the error code of the transaction node that is abnormal in its downstream link at one time according to the returned call information, and then obtain the log information related to the error code, and pass The log information derives the root cause of the abnormal transaction call, and quickly locates the target transaction node that caused the root cause through the root cause, and finally sends the root cause to the target transaction node so that the target transaction node can repair it according to the root cause.
  • This solution does not It is necessary to troubleshoot each node one by one.
  • the first transaction node can comprehensively and accurately diagnose the root cause of abnormality in the transaction link according to the corresponding log information of each error code, which improves the abnormal transaction when an abnormality occurs in the transaction link. The efficiency of node location and exception handling.
  • FIG. 1 is a schematic flowchart of a method for processing a transaction link abnormality provided by an embodiment of the present application
  • Figure 2 is a schematic diagram of the interaction of each node in the transaction link provided by an embodiment of the present application
  • FIG. 3 is a schematic structural diagram of a transaction link abnormal processing device provided by an embodiment of the present application.
  • Fig. 4 is a schematic structural diagram of another transaction link abnormal processing device provided by an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the transaction link exception processing method of the present application is suitable for exception processing in the transaction link.
  • a transaction processing requires more than two transaction nodes and more than ten or even dozens of transaction calls to complete the transaction.
  • each transaction node if there is an abnormality in transaction calls between different transaction nodes, each transaction node generally returns a specific error code defined by itself, and each transaction node can only perceive the abnormality of the downstream transaction node directly called. For example, when a user places an order, the transaction request will pass through the order transaction node, cash register transaction node, account system transaction node, payment channel transaction node, and bank transaction node in turn.
  • the account system transaction node can only sense the direct call
  • the payment channel transaction node is abnormal, but the bank transaction node that is indirectly called through the payment channel transaction node cannot be sensed.
  • the current existing solutions need to troubleshoot the log information of each node one by one.
  • the abnormal location and abnormal handling efficiency of the transaction link of multiple transaction nodes can be improved. For details, see the following description.
  • FIG. 1 is a schematic flowchart of a method for processing an abnormality of a data calculation link (transaction link) provided by an embodiment of the present application.
  • the transaction call exception is thrown when the current transaction node's processing of the transaction message does not conform to the preset processing logic, and the transaction call exception includes system call exceptions and business calls Exceptions, where system call exceptions are abnormalities in which the hardware of the transaction node or operating system fails, and business call exceptions are those caused by calls that do not meet business requirements.
  • the first transaction node is the uppermost transaction node in the transaction link, that is, the transaction node that initiates the call earliest, and the second transaction node is the next transaction node connected to the first transaction node.
  • the first transaction node receives the invocation information returned by the second transaction node, where the invocation information includes error codes of N transaction nodes, where N is an integer greater than zero.
  • the error codes of the N transaction nodes include the error codes of the second transaction node and the error codes of N-1 other transaction nodes.
  • FIG. 2 is a schematic diagram of the interaction of each node in the transaction link provided by an embodiment of the present application.
  • a transaction link includes: transaction node A, transaction node B, transaction node C, transaction node D, transaction node E, a total of 5 transaction nodes
  • the mutual transaction call relationship includes: transaction node A calls transaction node B, Transaction node B calls transaction node C, transaction node C calls transaction node D and transaction node E, transaction node D and transaction node E return a response to transaction node C, transaction node C returns a response to transaction node B, and transaction node B returns a response to Transaction node A.
  • the transaction nodes may be logical nodes divided according to logical functions, or physical nodes divided according to actual physical service nodes, which are not specifically limited in this application.
  • the invocation information may include: whether the transaction invocation service is processed successfully, and, in the case of a transaction invocation processing exception, the invocation information includes error context, errors of the N transaction nodes The code is recorded in the error context.
  • the error code stack mode can be used for recording
  • the error code queue mode can also be used for recording
  • other data structures can be used for recording.
  • transaction node C after transaction node C generates the error code of transaction node C, if transaction node C has received the error context in the call information fed back by transaction node E, and the error context has been recorded The error code of transaction node E, transaction node C can add the error code of transaction node C to the error context, so that the error code of transaction node C and the error code of transaction node E are recorded in the error context.
  • the current transaction node can create a new error context and record the error code of the system at the new level. In the wrong context. For example, when a transaction call exception occurs, transaction node E can generate an error code of transaction node E, create a new error context, record the error code of transaction node E in the error context, and feed it back to transaction node C.
  • the upper-level transaction node can obtain the error code of the transaction node that is abnormal in its downstream transaction link at one time according to the returned call information, and the abnormality can be quickly located according to the error code There is no need to troubleshoot each node one by one, which improves the efficiency of locating abnormal transaction nodes.
  • the error codes generated by different transaction nodes have the same data format.
  • the error code of transaction node C generated at transaction node C and the error code of transaction node E generated at transaction node E have the same data format.
  • the error codes generated by different transaction nodes all adopt the TLV (Tag-Length-Value) data format.
  • TLV is an abbreviation of Tag, Length, and Value.
  • a basic data element includes the above three fields.
  • Tag uniquely identifies the data element, Length is the length of the Value field, and Value is the data itself.
  • TLV data format is conducive to the expansion of error code content. See Table 1 for details. Table 1 is an example of the error code data format.
  • digits 1 to 5 represent the error level.
  • the error level can be divided into 4 different error levels, the error level from low to high is: INFO, WARN, ERROR, FATAL.
  • INFO-level log information is used to output some important information about program operation in the production environment
  • WARN-level log information is used to warn potential errors
  • ERROR-level log information indicates that although an error event occurs, it still does not affect the continued operation of the system.
  • the FATAL level log information records serious error events, and the error time will cause the application to crash.
  • Digits 6 to 11 represent the transaction node number, which uniquely identifies the transaction node.
  • each transaction node is assigned a transaction node number in advance to uniquely identify the transaction node, and a specific transaction node can be directly located through an error code according to this identification.
  • the transaction node number can also be represented by the IP (Internet Protocol) address of the transaction node or the domain name of the transaction node. The embodiment of the application does not specifically limit the transaction node number.
  • Bits 12 to 18 represent the error code, which is a self-defined error code within each transaction node, such as the custom error shown in Table 2.
  • Illegal request parameter 1001 User authentication failed 1002
  • Illegal authorization information 1003 Application is not authorized 1004
  • Information is invalid or out of range 1006
  • the update token provided has expired 1007
  • the field does not match the one filled in when registering the app 1008
  • the error code data format is only an example, the error code may include more data content, or may be a fixed format other than the TLV format, which is not limited in this application.
  • the embodiment of this application requires that the data format of the error codes used by the transaction nodes of each layer is the same. The purpose is to use the same data format to facilitate the upstream transaction node's error code for each transaction node in the downstream transaction link Perform unified processing.
  • the first transaction node obtains log information of each of the N transaction nodes according to the N error codes.
  • the error code includes the identifier of the transaction node, and the first transaction node determines the N transaction call abnormalities based on the identifiers of the N transaction nodes included in the N error codes.
  • Transaction node where the identifier may be the domain name or Internet Protocol address of the transaction node; the first transaction node obtains log information related to the N error codes from the N transaction nodes, which is specifically implemented as :
  • the first transaction node sends respective error codes to the N transaction nodes, and after receiving the respective error codes, the N transaction nodes query log information according to the respective error codes
  • the library obtains the log information related to the respective error codes, and then sends the log information related to the respective error codes to the first transaction node.
  • the first transaction node determines the root cause of the abnormal transaction call of the transaction link and the target transaction node that caused the root cause according to the log information of each transaction node.
  • the log information is standardized log information, and the standardized log information conforms to the log standard format.
  • Step 103 can be implemented in the following manner: the first transaction node matches the standardized log information according to a regular expression. Log information to determine the first target location of the root cause; the first transaction node extracts the root cause of the abnormal transaction call of the transaction link according to the first target location, and determines the cause based on the root cause The target transaction node of the root cause. In this solution, the first transaction node determines the first target location of the root cause according to the regular expression matching standardized log information.
  • This application provides two implementation methods. For details, refer to the following description.
  • the first transaction node matches each log segment with an error identifier in the standardized log information according to a regular expression; wherein the content of each log segment is the reason for the error identifier; the first transaction node matches the log segment according to the
  • the log printing time determines the location of the log segment with the earliest log printing time as the first target location of the root cause.
  • the regular expression is usually used to retrieve text that conforms to a certain pattern (rule).
  • regular expressions are used to retrieve log segments with error identifiers.
  • the error identifiers can be INFO, WARN, ERROR, FATAL, etc.
  • the root cause location can be obtained according to the log print time of each log segment, that is, the log segment with the earliest log print time is used as the root cause location.
  • the location of the root cause based on the log printing time is suitable for a transaction link with only one link.
  • the first transaction node matches each log segment with an error identifier in the standardized log information according to the regular expression; the content of each log segment is the reason for the error identifier; the first transaction node matches the log segment according to the
  • the log error level determines the location of the log segment with the highest log error level as the first target location of the root cause.
  • the regular expression is usually used to retrieve text that conforms to a certain pattern (rule).
  • regular expressions are used to retrieve log segments with error identifiers.
  • the error identifiers can be INFO, WARN, ERROR, FATAL, etc.
  • the root cause location can be obtained according to the log error level of each log segment, that is, the log segment with the highest log error level is used as the root cause location.
  • the location of the root cause determined according to the log error level is applicable to the transaction link of the multi-branch link.
  • the first transaction node indicates the root cause to the target transaction node, so that the target transaction node can repair the link abnormality according to the root cause.
  • transaction node B can only determine through the error code that the exception is caused by the absence of the memory space pointed to by the pointer.
  • transaction node B cannot determine the The abnormality is caused by the processing logic of its own transaction node conforming to the preset logic, or the processing logic of its downstream transaction node does not conform to the preset logic. Therefore, transaction node A needs to perform step S101-step S103 to obtain the root cause of the null pointer abnormality.
  • the root cause of the null pointer abnormality obtained by transaction node A is that transaction node E has not uploaded the specified file, and then transaction node A Send the root cause of the null pointer exception to the transaction node E, and the transaction node E can repair the link exception based on the root cause sent by the transaction node A.
  • the abnormal location and abnormal handling efficiency of the transaction link are improved, and it is avoided to check each transaction node in the transaction link one by one.
  • the first transaction node can obtain the error code of the transaction node that is abnormal in its downstream link at one time according to the returned call information, and then obtain the log information related to the error code, and obtain the log information from the log information
  • the root cause of the abnormal transaction call and quickly locate the target transaction node that caused the root cause through the root cause, and finally send the root cause to the target transaction node, so that the target transaction node can repair according to the root cause.
  • the node eliminates the problem.
  • the first transaction node can comprehensively and accurately diagnose the root cause of the abnormality in the transaction link according to the corresponding log information of each error code, which improves the location and abnormality of the abnormal transaction node when an abnormality occurs in the transaction link. Processing efficiency.
  • FIG. 3 is a schematic structural diagram of a transaction link exception processing apparatus provided by an embodiment of the present application.
  • the device is applied to a transaction link, and the transaction link includes a plurality of transaction nodes; the device 300 includes: a receiving unit 301, an obtaining unit 302, a determining unit 303, and an indicating unit 304.
  • the receiving unit 301 is used for receiving the calling information returned by the second transaction node by the first transaction node in the case of abnormal transaction invocation on the transaction link;
  • the invocation information includes the error codes of N transaction nodes, and the N Is an integer greater than 0;
  • the second transaction node is the next transaction node of the first transaction node;
  • the obtaining unit 302 is configured to obtain the log information of each of the N transaction nodes by the first transaction node according to the N error codes;
  • the determining unit 303 is configured to determine the root cause of the abnormal transaction call of the transaction link and the target transaction node that caused the root cause by the first transaction node according to the log information of each transaction node;
  • the indicating unit 304 is configured to indicate the root cause to the target transaction node by the first transaction node, so that the target transaction node can repair the link abnormality according to the root cause.
  • the log information is standardized log information, and the standardized log information conforms to a log standard format.
  • the determining unit 303 includes a matching unit 401, an extracting unit 402, and the matching unit 401 Used to match the standardized log information according to a regular expression to determine the first target location of the root cause; the extracting unit 402 is used to extract the transaction of the transaction link according to the first target location Call the root cause of the abnormality, and determine the target transaction node that caused the root cause according to the root cause.
  • the matching unit 401 is configured to match each log segment with an error identifier in the standardized log information according to the regular expression; the content of each log segment is the content of the error identifier.
  • Reason According to the log print time of each log segment, the location of the log segment with the earliest log print time is determined as the first target location of the root cause.
  • the matching unit 401 is further configured to match each log segment with an error identifier in the standardized log information according to the regular expression; the content of each log segment is the occurrence of the error identifier The reason; according to the log error level of each log segment, the location of the log segment with the highest log error level is determined as the first target location of the root cause.
  • the error code includes the identifier of the transaction node
  • the acquiring unit 302 is configured to determine, according to the identifiers of the N transaction nodes included in the N error codes, that an abnormal transaction call occurs N transaction nodes; obtain log information related to the N error codes from the N transaction nodes.
  • the error codes of the N transaction nodes include the error codes of the second transaction node and the error codes of N-1 other transaction nodes .
  • the error codes of the N transaction nodes have the same data format.
  • the functions or modules contained in the apparatus provided in the embodiments of the application can be used to execute the methods described in the above method embodiments.
  • the functions or modules contained in the apparatus provided in the embodiments of the application can be used to execute the methods described in the above method embodiments.
  • An embodiment of the present application further provides an electronic device, including: a memory, configured to store executable instructions; and a processor, configured to communicate with the memory to execute the executable instructions, thereby completing any of the foregoing embodiments of the present application. Describes the operation of the transaction link exception handling method.
  • FIG. 5 is a structural block diagram of an electronic device provided by an embodiment of the present application.
  • the electronic device includes: one or more processors 501; one or more input interfaces 502, one or more output interfaces 503, and a memory 504.
  • the aforementioned processor 501, input interface 502, output interface 503, and memory 504 are connected via a bus 505.
  • the memory 502 is used to store instructions
  • the processor 501 is used to execute instructions stored in the memory 502.
  • the processor 501 is configured to call the program instructions to execute:
  • the call information returned by the second transaction node is received through the input interface 502;
  • the call information includes the error codes of N transaction nodes, where N is an integer greater than 0;
  • the first transaction node is the uppermost transaction node of the transaction link;
  • the second transaction node is the next transaction node of the first transaction node;
  • the first transaction node obtains log information of each of the N transaction nodes through the input interface 502 according to the N error codes;
  • the first transaction node determines the root cause of the abnormal transaction call of the transaction link and the target transaction node that caused the root cause according to the log information of each transaction node;
  • the root cause is indicated to the target transaction node, so that the target transaction node can repair the link abnormality according to the root cause.
  • the processor 501 may be a central processing unit (Central Processing Unit, CPU), and the processor may also be other general-purpose processors or digital signal processors (DSP). , Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the memory 504 may include a read-only memory and a random access memory, and provides instructions and data to the processor 501. A part of the memory 504 may also include a non-volatile random access memory. For example, the memory 504 may also store device type information.
  • the processor 501 is used to execute the transaction link abnormal processing method described in the embodiments of the present application
  • the input interface 502 is used to receive data
  • the output interface 503 is used to output data.
  • the processor 501, the input interface 502, and the output interface 503 can execute the implementation manners described in the various embodiments of the transaction link exception handling method provided in the embodiments of the present application. For brevity, details are not repeated here.
  • a computer-readable storage medium stores a computer program, the computer program includes program instructions, and the program instructions are implemented when executed by a processor:
  • the first transaction node receives the call information returned by the second transaction node;
  • the call information includes the error codes of N transaction nodes, where N is an integer greater than 0;
  • a transaction node is the uppermost transaction node of the transaction link;
  • the second transaction node is the next transaction node of the first transaction node;
  • the first transaction node obtains the transaction node according to the N error codes
  • the first transaction node determines, according to the log information of each transaction node, the root cause of the abnormal transaction call of the transaction link and the root cause Target transaction node;
  • the first transaction node indicates the root cause to the target transaction node, so that the target transaction node can repair the link abnormality according to the root cause.
  • the computer-readable storage medium may be an internal storage unit of the electronic device described in any of the foregoing embodiments, such as a hard disk or memory of a terminal.
  • the computer-readable storage medium may also be an external storage device of the terminal, such as a plug-in hard disk equipped on the terminal, a Smart Media Card (SMC), or a Secure Digital (SD) card , Flash Card, etc.
  • the computer-readable storage medium may also include both an internal storage unit of the electronic device and an external storage device.
  • the computer-readable storage medium is used to store the computer program and other programs and data required by the electronic device.
  • the computer-readable storage medium can also be used to temporarily store data that has been output or will be output.

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Debugging And Monitoring (AREA)

Abstract

一种基于数据计算链路的异常处理方法以及相关设备,数据计算链路为交易链路,交易链路包括多个交易节点;该方法包括:在交易链路出现交易调用异常的情况下,第一交易节点接收第二交易节点返回的调用信息;根据N个错误码,获取N个交易节点中的各个交易节点的日志信息;根据各个交易节点的日志信息,确定交易链路的交易调用异常的根因以及导致根因的目标交易节点;向目标交易节点指示根因,以便于目标交易节点根据根因进行链路异常的修复。通过上述方法,能提高交易链路中的异常节点的定位效率。

Description

基于数据计算链路的异常处理方法以及相关设备
本申请要求于2019年05月20日提交中国专利局、申请号为201910420339X、申请名称为“交易链路异常处理方法以及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据处理技术领域,尤其涉及一种基于数据计算链路的异常处理方法以及相关设备。
背景技术
交易行为属于一种数据计算(或称数据结算)行为,在交易过程中,通常一笔交易的完成需要经过多个团队共同合作完成,例如,当用户购买一种产品时,该交易请求会途经订单节点、收银台节点、账号体系节点、支付通道节点、以及银行节点等,而上述涉及的节点是分别由不同的研发团队负责的。当该交易请求发生异常时,由于交易请求途径的节点较多,定位异常节点和处理异常的效率低下。
发明内容
本申请提出一种基于数据计算链路的异常处理技术方案,能提高数据计算链路尤其是交易链路中的异常节点的定位效率。
根据本申请第一方面,提供一种基于数据计算链路的异常处理方法,所述数据计算链路具体为交易链路,所述交易链路包括多个交易节点;所述方法包括:在交易链路出现交易调用异常的情况下,第一交易节点接收第二交易节点返回的调用信息;所述调用信息包括N个交易节点的错误码,所述N为大于0的整数;所述第一交易节点为所述交易链路的最上层交易节点;所述第二交易节点为所述第一交易节点的下一交易节点;所述第一交易节点根据N个所述错误码,获取所述N个交易节点中的各个交易节点的日志信息;所述第一交易节点根据所述各个交易节点的日志信息,确定所述交易链路的交易调用异常的根因以及导致所述根因的目标交易节点;所述第一交易节点向所述目标交易节点指示所述根因,以便于所述目标交易节点根据所述根因 进行链路异常的修复。通过实施本申请实施例可以提高多交易节点的交易链路的异常定位和异常处理效率。
在一些实施例中,所述日志信息为标准化的日志信息,所述标准化的日志信息符合日志标准格式,所述第一交易节点根据所述各个交易节点的日志信息,确定所述交易链路的交易调用异常的根因以及导致所述根因的目标交易节点,具体包括:所述第一交易节点根据正则表达式匹配所述标准化的日志信息,确定所述根因的第一目标位置;所述第一交易节点根据所述第一目标位置,提取所述交易链路的交易调用异常的根因,并根据所述根因确定导致所述根因的目标交易节点。第一交易节点可以根据各个错误码的对应的日志信息,全面、准确地诊断交易链路中异常出现的根因,提高了交易链路中发生异常时异常交易节点定位和异常处理的效率。
在一些实施例中,所述第一交易节点根据正则表达式匹配所述标准化的日志信息,确定所述根因的第一目标位置,包括:所述第一交易节点根据所述正则表达式匹配所述标准化的日志信息中出现错误标识的各个日志段;所述各个日志段的内容为发生所述错误标识的原因;所述第一交易节点根据所述各个日志段的日志打印时间,将所述日志打印时间最早的日志段的所在位置,确定为所述根因的第一目标位置。所述正则表达式被用来检索符合某个模式(规则)的文本,这里使用正则表达式来检索具有错误标识的日志段,其中错误标识可以是INFO,WARN,ERROR,FATAL等,从而提高了检索的效率。本实施例根据日志打印时间确定根因的位置的方案可适用于只有一条链路的交易链路。
在一些实施例中,所述第一交易节点根据正则表达式匹配所述标准化的日志信息,确定所述根因的第一目标位置,包括:所述第一交易节点根据所述正则表达式匹配所述标准化的日志信息中出现错误标识的各个日志段;所述各个日志段的内容为发生所述错误标识的原因;所述第一交易节点根据所述各个日志段的日志错误等级,将所述日志错误等级最高的日志段的所在位置,确定为所述根因的第一目标 位置。正则表达式来检索具有错误标识的日志段,其中错误标识可以是INFO,WARN,ERROR,FATAL等,提高了检索的效率。本实施例根据日志错误等级确定的根因的位置的方案可适用于多分支链路的交易链路。
在一些实施例中,所述错误码包括所述交易节点的标识,所述第一交易节点根据N个所述错误码,获取所述N个交易节点中的各个交易节点的日志信息,包括:所述第一交易节点根据所述N个所述错误码包括的N个交易节点的标识,确定出现交易调用异常的N个交易节点;所述第一交易节点向所述N个交易节点,获取与N个所述错误码相关的日志信息。这样,第一交易节点可以根据各个交易节点返回的调用信息中一次性获取在其下游交易链路中发生异常的交易节点的错误码,根据错误码可快速定位到异常的交易节点,不需要逐个对各个节点进行问题排除,提高了异常交易节点定位效率。
在一些实施例中,在第二交易节点也出现交易调用异常的情况下,所述N个交易节点的错误码包括所述第二交易节点的错误码以及N-1个其他交易节点的错误码,从而提高了交易链路的异常定位和异常处理效率,避免了逐个排查交易链路中的各个交易节点。
在一些实施例中,所述N个交易节点的错误码具有相同的数据格式。使用相同的数据格式,方便了上游交易节点对其下游交易链路中的各个交易节点的错误码进行统一处理。
本申请第二方面,提供一种数据计算链路的异常处理装置,所述数据计算链路为交易链路,所述交易链路包括多个交易节点;所述装置包括:接收单元,获取单元,确定单元,指示单元,所述接收单元用于,在交易链路出现交易调用异常的情况下,接收第二交易节点返回的调用信息;所述调用信息包括N个交易节点的错误码,所述N为大于0的整数;所述第二交易节点为所述第一交易节点的下一交易节点;所述获取单元用于,根据N个所述错误码,获取所述N个交易节点中的各个交易节点的日志信息;所述确定单元用于,根据所述各个交易节点的日志信息,确定所述交易链路的交易调用异常的根因以及 导致所述根因的目标交易节点;所述指示单元用于,向所述目标交易节点指示所述根因,以便于所述目标交易节点根据所述根因进行链路异常的修复。过实施本申请实施例可以提高多交易节点的交易链路的异常定位和异常处理效率。
在一些实施例中,所述日志信息为标准化的日志信息,所述标准化的日志信息符合日志标准格式,所述确定单元可进一步包括匹配单元和提取单元,所述匹配单元用于,根据正则表达式匹配所述标准化的日志信息,确定所述根因的第一目标位置;所述提取单元用于,根据所述第一目标位置,提取所述交易链路的交易调用异常的根因,并根据所述根因确定导致所述根因的目标交易节点。
在一些实施例中,所述匹配单元用于,根据所述正则表达式匹配所述标准化的日志信息中出现错误标识的各个日志段;所述各个日志段的内容为发生所述错误标识的原因;根据所述各个日志段的日志打印时间,将所述日志打印时间最早的日志段的所在位置,确定为所述根因的第一目标位置。
在一些实施例中,所述匹配单元还用于,根据所述正则表达式匹配所述标准化的日志信息中出现错误标识的各个日志段;所述各个日志段的内容为发生所述错误标识的原因;根据所述各个日志段的日志错误等级,将所述日志错误等级最高的日志段的所在位置,确定为所述根因的第一目标位置。
在一些实施例中,所述错误码包括所述交易节点的标识,所述获取单元用于,根据所述N个所述错误码包括的N个交易节点的标识,确定出现交易调用异常的N个交易节点;向所述N个交易节点,获取与N个所述错误码相关的日志信息。
在一些实施例中,在第二交易节点也出现交易调用异常的情况下,所述N个交易节点的错误码包括所述第二交易节点的错误码以及N-1个其他交易节点的错误码。
在一些实施例中,所述N个交易节点的错误码具有相同的数据格式。
根据本申请第三方面,提供一种电子设备,该电子设备包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为调用所述存储器存储的指令,对所述指令的调用使得所述处理器执行本申请第一方面任一实施例的方法。
根据本申请第四方面,提供一种计算机可读存储介质,所述计算机可读存储介质可以是计算机非易失性可读存储介质,例如只读内存存储器(Read-only memory,ROM),闪存(Flash memory)等,也可以是计算机易失性可读存储介质,例如随机存取存储器(Random Access Memory,RAM)等。所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行以本申请第一方面任一实施例的方法。
通过实施上述交易链路异常处理方法,在第一交易节点可以根据返回的调用信息中一次性获取在其下游链路中发生异常的交易节点的错误码,然后获取错误码相关的日志信息,通过日志信息得出交易调用异常的根因,并且通过根因快速定位出导致根因的目标交易节点,最后将根因发送给目标交易节点,以便于目标交易节点根据根因进行修复,本方案不需要逐个对各个节点进行问题排除,第一交易节点可以根据各个错误码的对应的日志信息,全面、准确地诊断交易链路中异常出现的根因,提高了交易链路中发生异常时异常交易节点定位和异常处理的效率。
本申请附加的方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本申请的实践了解到。
附图说明
图1是本申请实施例提供的一种交易链路异常处理方法示意流程图;
图2是本申请实施例提供的交易链路中各节点的交互示意图;
图3是本申请实施例提供的一种交易链路异常处理装置结构示意图;
图4是本申请实施例提供的另一种交易链路异常处理装置结构 示意图;
图5是本申请实施例提供的一种电子设备结构示意图。
具体实施方式
为了便于后文的理解,首先对本申请实施例的应用场景进行描述。本申请的交易链路异常处理方法适用于交易链路中的异常处理,通常情况下,一笔交易处理需要两个以上的交易节点,十多次甚至几十次交易调用才能完成交易。目前不同交易节点之间的交易调用,如果出现异常,一般是每个交易节点返回自己定义的特定错误码,每个交易节点只能感知直接调用的下游交易节点的异常。例如,当用户下单时,该交易请求会依次途经订单交易节点、收银台交易节点、账号体系交易节点、支付通道交易节点、以及银行交易节点,其中,账号体系交易节点只能感知直接调用的支付通道交易节点的异常,但不能感知通过支付通道交易节点间接去调用的银行交易节点的异常。当交易发生异常时,目前现有的方案,需要逐个对各个节点的日志信息进行问题排除,当涉及的节点较多时,需要排查的时间较长,定位异常和处理异常的速度较慢。通过实施本申请实施例可以提高多交易节点的交易链路的异常定位和异常处理效率,具体见下文描述。
请参见图1,图1是本申请实施例提供的数据计算链路(交易链路)异常处理方法示意流程图。
S101、在交易链路出现交易调用异常的情况下,第一交易节点接收第二交易节点返回的调用信息。
在一些可能的实现方式中,所述交易调用异常是在所述当前交易节点对交易消息的处理不符合预设处理逻辑的情况下抛出的,所述交易调用异常包括系统调用异常和业务调用异常,其中系统调用异常为交易节点的硬件出现故障或操作系统出现故障的异常,业务调用异常为调用不满足业务需求产生的异常。
在本申请实施例中,第一交易节点是交易链路中的最上层交易节点,即最早发起调用的交易节点,第二交易节点是与第一交易节点相连的下一交易节点。在交易链路出现交易调用异常的情况下,第一交 易节点接收第二交易节点返回的调用信息,其中调用信息包括N个交易节点的错误码,所述N为大于0的整数。在第二交易节点也出现交易调用异常的情况下,N个交易节点的错误码包括第二交易节点的错误码以及N-1个其他交易节点的错误码。
下面以图2进行举例说明,图2是本申请实施例提供的交易链路中各节点的交互示意图。假设一个交易链路包括:交易节点A,交易节点B,交易节点C,交易节点D,交易节点E,共5个交易节点,相互之间的交易调用关系包括:交易节点A调用交易节点B,交易节点B调用交易节点C,交易节点C调用交易节点D和交易节点E,交易节点D和交易节点E返回响应给交易节点C,交易节点C返回响应给交易节点B,交易节点B返回响应给交易节点A。在本申请实施例中,所述交易节点可以是根据逻辑功能划分的逻辑节点,也可以是根据实际存在的物理业务节点划分的物理节点,本申请对此不做具体限定。
在一些可能的实施例中,调用信息中可以包括:交易调用业务是否处理成功,以及,在出现交易调用处理异常的情况下,所述调用信息中包括错误上下文,所述N个交易节点的错误码记录在错误上下文中。
在一些可能的实施例中,在将N个交易节点的错误码记录在错误上下文中时,可以采用错误码堆栈方式进行记录,也可以采用错误码队列方式进行记录,也可以采用其他数据结构进行记录,本申请对此不做具体限定。
举例来说,如图2所示,交易节点C在生成交易节点C的错误码后,如果交易节点C已经接收到交易节点E反馈的调用信息中包括了错误上下文,且该错误上下文中已经记录交易节点E的错误码,则交易节点C可以在错误上下文中添加交易节点C的错误码,使得错误上下文中记录交易节点C的错误码和交易节点E的错误码。
另外,如果当前交易节点生成当前交易节点的错误码时,接收到其他交易节点的反馈的调用信息没有包括错误上下文,则当前交易节 点可以新建错误上下文并将本层系统的错误码记录在新建的错误上下文中。例如,交易节点E在发生交易调用异常时,可以生成交易节点E的错误码,并新建错误上下文,将交易节点E的错误码记录在错误上下文中并反馈给交易节点C。
通过实施上述交易链路异常处理的实施例,在上层交易节点可以根据返回的调用信息中一次性获取在其下游交易链路中发生异常的交易节点的错误码,根据错误码可快速定位到异常的交易节点,不需要逐个对各个节点进行问题排除,提高了异常交易节点定位效率。
在本申请实施例中,不同交易节点生成的错误码具有相同的数据格式,例如在交易节点C生成交易节点C的错误码和在交易节点E生成交易节点E的错误码的数据格式相同。在一些可能的实施例中,不同交易节点生成的错误码都采用TLV(Tag-Length-Value)数据格式,TLV是Tag,Length,Value的缩写,一个基本的数据元就包括上面三个域。Tag唯一标识该数据元,Length是Value域的长度,Value就是数据本身了。使用TLV数据格式有利于错误码内容的扩展。具体参见表1,表1是错误码数据格式的一个示例。
表1 错误码数据格式示例
Figure PCTCN2019121692-appb-000001
其中,1至5位表示错误等级,具体实现中可以将错误等级划分为4个不同的错误等级,错误等级由低到高依次为:INFO,WARN,ERROR,FATAL。其中INFO等级的日志信息用于生产环境中输出程序运行的一些重要信息,WARN等级的日志信息用于警告潜在错误,ERROR等级的日志信息指出虽然发生错误事件,但仍然不影响系统的继续运行,FATAL等级的日志信息记录了严重的错误事件,并 且该错误时间会导致应用程序的崩溃。
6至11位表示交易节点编号,该交易节点编号唯一标识了交易节点。具体实现中,预先为各个交易节点分配一个交易节点编号,以唯一标识这个交易节点,根据这个标识可以通过一个错误码直接定位到具体的交易节点。在其他实现方案中,交易节点编号还可以使用该交易节点的IP(Internet Protocol)地址表示,也可以使用该交易节点的域名表示,本申请实施例对交易节点编号不做具体限定。
12至18位表示错误编码,该错误编码是各个交易节点内部自行定义的错误码,例如表2中所示的自定义错误。
表2 自定义错误
错误码 错误描述
1000 非法的请求参数
1001 用户认证失败
1002 非法的授权信息
1003 应用没有被授权
1004 字段超过定义范围
1005 信息无效或超出范围
1006 提供的更新令牌已过期
1007 字段与注册应用时所填写的不匹配
1008 服务器拒绝授予数据访问权限
需要理解的是,上述错误码数据格式的示例仅仅是一个例子,错误码可以包括更多的数据内容,也可以是除TLV格式以外的其他的固定格式,本申请对此不做限定。本申请实施例要求每一层的交易节点所使用的错误码的数据格式相同,其目的在于,使用相同的数据格式,方便了上游交易节点对其下游交易链路中的各个交易节点的错误码进行统一处理。
S102、所述第一交易节点根据N个所述错误码,获取所述N个交 易节点中的各个交易节点的日志信息。
在一些实施例中,所述错误码包括所述交易节点的标识,所述第一交易节点根据所述N个所述错误码包括的N个交易节点的标识,确定出现交易调用异常的N个交易节点,其中所述标识可以是所述交易节点的域名或者互联网协议地址;所述第一交易节点向所述N个交易节点,获取与N个所述错误码相关的日志信息,具体实现为:所述第一交易节点向所述N个交易节点分别发送各自对应的错误码,所述N个交易节点接收到所述各自对应的错误码后,根据所述各自对应的错误码查询日志信息库,得到与所述各自对应的错误码相关的日志信息,然后将与所述各自对应的错误码相关的日志信息发送给所述第一交易节点。
S103、所述第一交易节点根据所述各个交易节点的日志信息,确定所述交易链路的交易调用异常的根因以及导致所述根因的目标交易节点。
在一些实施例中,所述日志信息为标准化的日志信息,所述标准化的日志信息符合日志标准格式,步骤103可以通过如下方式实现:所述第一交易节点根据正则表达式匹配所述标准化的日志信息,确定所述根因的第一目标位置;所述第一交易节点根据所述第一目标位置,提取所述交易链路的交易调用异常的根因,并根据所述根因确定导致所述根因的目标交易节点。本方案中,第一交易节点根据正则表达式匹配标准化的日志信息,确定根因的第一目标位置,本申请给出两种实现方式,具体参见下文描述。
其一,第一交易节点根据正则表达式匹配标准化的日志信息中出现错误标识的各个日志段;其中,各个日志段的内容为发生所述错误标识的原因;第一交易节点根据各个日志段的日志打印时间,将日志打印时间最早的日志段的所在位置,确定为所述根因的第一目标位置。所述正则表达式通常被用来检索符合某个模式(规则)的文本,这里使用正则表达式来检索具有错误标识的日志段,其中错误标识可以是INFO,WARN,ERROR,FATAL等,在得到具有错误标识的各个日志段后, 然后根据各个日志段的日志打印时间,可得出根因位置,即将日志打印时间最早的的日志段作为所述根因的位置。其中根据日志打印时间确定根因的位置适用于只有一条链路的交易链路。
其二,第一交易节点根据正则表达式匹配所述标准化的日志信息中出现错误标识的各个日志段;各个日志段的内容为发生所述错误标识的原因;第一交易节点根据各个日志段的日志错误等级,将日志错误等级最高的日志段的所在位置,确定为所述根因的第一目标位置。所述正则表达式通常被用来检索符合某个模式(规则)的文本,这里使用正则表达式来检索具有错误标识的日志段,其中错误标识可以是INFO,WARN,ERROR,FATAL等,在得到具有错误标识的各个日志段后,然后根据各个日志段的日志错误等级,可得出根因位置,即将日志错误等级最高的的日志段作为所述根因的位置。其中根据日志错误等级确定的根因的位置适用于多分支链路的交易链路。
S104、所述第一交易节点向所述目标交易节点指示所述根因,以便于所述目标交易节点根据所述根因进行链路异常的修复。
例如,图2的交易链路中的交易节点B发生空指针异常时,交易节点B通过错误码仅能确定该异常是由指针指向的内存空间不存在导致的,另外,交易节点B不能确定该异常是自身交易节点的处理逻辑符合预设逻辑导致的,还是其下游交易节点的处理逻辑不符合预设逻辑导致的。因此,需要交易节点A执行步骤S101-步骤S103后,得到所述空指针异常的根因,例如这里交易节点A得出空指针异常的根因是交易节点E未上传指定文件,然后交易节点A向交易节点E发送空指针异常的根因,交易节点E即可根据交易节点A发送的根因进行链路异常的修复。通过实施上述实施例,提高了交易链路的异常定位和异常处理效率,避免了逐个排查交易链路中的各个交易节点。
本申请实施例中,在第一交易节点可以根据返回的调用信息中一次性获取在其下游链路中发生异常的交易节点的错误码,然后获取错误码相关的日志信息,通过日志信息得出交易调用异常的根因,并且通过根因快速定位出导致根因的目标交易节点,最后将根因发送给目 标交易节点,以便于目标交易节点根据根因进行修复,本方案不需要逐个对各个节点进行问题排除,第一交易节点可以根据各个错误码的对应的日志信息,全面、准确地诊断交易链路中异常出现的根因,提高了交易链路中发生异常时异常交易节点定位和异常处理的效率。
请参见图3,图3是本申请实施例提供的交易链路异常处理装置结构示意图。所述装置应用于交易链路,所述交易链路包括多个交易节点;所述装置300包括:接收单元301,获取单元302,确定单元303,指示单元304。
所述接收单元301用于,在交易链路出现交易调用异常的情况下,第一交易节点接收第二交易节点返回的调用信息;所述调用信息包括N个交易节点的错误码,所述N为大于0的整数;所述第二交易节点为所述第一交易节点的下一交易节点;
所述获取单元302用于,所述第一交易节点根据N个所述错误码,获取所述N个交易节点中的各个交易节点的日志信息;
所述确定单元303用于,所述第一交易节点根据所述各个交易节点的日志信息,确定所述交易链路的交易调用异常的根因以及导致所述根因的目标交易节点;
所述指示单元304用于,所述第一交易节点向所述目标交易节点指示所述根因,以便于所述目标交易节点根据所述根因进行链路异常的修复。
在一些实施例中,参见图4,所述日志信息为标准化的日志信息,所述标准化的日志信息符合日志标准格式,所述确定单元303包括匹配单元401,提取单元402,所述匹配单元401用于,根据正则表达式匹配所述标准化的日志信息,确定所述根因的第一目标位置;所述提取单元402用于,根据所述第一目标位置,提取所述交易链路的交易调用异常的根因,并根据所述根因确定导致所述根因的目标交易节点。
在一些实施例中,所述匹配单元401用于,根据所述正则表达式匹配所述标准化的日志信息中出现错误标识的各个日志段;所述各个 日志段的内容为发生所述错误标识的原因;根据所述各个日志段的日志打印时间,将所述日志打印时间最早的日志段的所在位置,确定为所述根因的第一目标位置。
在一些实施例中,所述匹配单元401还用于,根据所述正则表达式匹配所述标准化的日志信息中出现错误标识的各个日志段;所述各个日志段的内容为发生所述错误标识的原因;根据所述各个日志段的日志错误等级,将所述日志错误等级最高的日志段的所在位置,确定为所述根因的第一目标位置。
在一些实施例中,所述错误码包括所述交易节点的标识,所述获取单元302用于,根据所述N个所述错误码包括的N个交易节点的标识,确定出现交易调用异常的N个交易节点;向所述N个交易节点,获取与N个所述错误码相关的日志信息。
在一些实施例中,在第二交易节点也出现交易调用异常的情况下,所述N个交易节点的错误码包括所述第二交易节点的错误码以及N-1个其他交易节点的错误码。
在一些实施例中,所述N个交易节点的错误码具有相同的数据格式。
在一些实施例中,本申请实施例提供的装置具有的功能或包含的模块可以用于执行上文方法实施例描述的方法,其具体实现可以参照上文方法实施例的描述,为了简洁,这里不再赘述。
本申请实施例还提供一种电子设备,包括:存储器,用于存储可执行指令;以及处理器,用于与所述存储器通信以执行所述可执行指令从而完成本申请上述任一实施例所述交易链路异常处理方法的操作。
图5是本申请实施例提供的一种电子设备结构框图。下面参考图5,其示出了适于用来实现本申请实施例的终端设备或服务器的电子设备的结构示意图。如图5所示,该电子设备包括:一个或多个处理器501;一个或多个输入接口502,一个或多个输出接口503和存储器504。上述处理器501、输入接口502、输出接口503和存储器504 通过总线505连接。存储器502用于存储指令,处理器501用于执行存储器502存储的指令。其中,处理器501被配置用于调用所述程序指令执行:
在交易链路出现交易调用异常的情况下,通过输入接口502,接收第二交易节点返回的调用信息;所述调用信息包括N个交易节点的错误码,所述N为大于0的整数;所述第一交易节点为所述交易链路的最上层交易节点;所述第二交易节点为所述第一交易节点的下一交易节点;
所述第一交易节点根据N个所述错误码,通过输入接口502,获取所述N个交易节点中的各个交易节点的日志信息;
所述第一交易节点根据所述各个交易节点的日志信息,确定所述交易链路的交易调用异常的根因以及导致所述根因的目标交易节点;
通过输出接口503,向所述目标交易节点指示所述根因,以便于所述目标交易节点根据所述根因进行链路异常的修复。
应当理解,在本申请实施例中,所称处理器501可以是中央处理单元(Central Processing Unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
该存储器504可以包括只读存储器和随机存取存储器,并向处理器501提供指令和数据。存储器504的一部分还可以包括非易失性随机存取存储器。例如,存储器504还可以存储设备类型的信息。
在一些实施例,所述处理器501用于执行本申请实施例描述的交易链路异常处理方法,所述输入接口502用于接收数据,所述输出接口503用于输出数据,通过所述处理器501、述输入接口502以及所述输出接口503可执行本申请实施例提供的一种交易链路异常处理方法各个实施例中所描述的实现方式,为了简洁,在此不再赘述。
在本申请的另一实施例中提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令被处理器执行时实现:在交易链路出现交易调用异常的情况下,第一交易节点接收第二交易节点返回的调用信息;所述调用信息包括N个交易节点的错误码,所述N为大于0的整数;所述第一交易节点为所述交易链路的最上层交易节点;所述第二交易节点为所述第一交易节点的下一交易节点;所述第一交易节点根据N个所述错误码,获取所述N个交易节点中的各个交易节点的日志信息;所述第一交易节点根据所述各个交易节点的日志信息,确定所述交易链路的交易调用异常的根因以及导致所述根因的目标交易节点;所述第一交易节点向所述目标交易节点指示所述根因,以便于所述目标交易节点根据所述根因进行链路异常的修复。
所述计算机可读存储介质可以是前述任一实施例所述的电子设备的内部存储单元,例如终端的硬盘或内存。所述计算机可读存储介质也可以是所述终端的外部存储设备,例如所述终端上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述计算机可读存储介质还可以既包括所述电子设备的内部存储单元也包括外部存储设备。所述计算机可读存储介质用于存储所述计算机程序以及所述电子设备所需的其他程序和数据。所述计算机可读存储介质还可以用于暂时地存储已经输出或者将要输出的数据。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (20)

  1. 一种基于数据计算链路的异常处理方法,其特征在于,所述数据计算链路为交易链路,所述交易链路包括多个交易节点;所述方法包括:
    在交易链路出现交易调用异常的情况下,第一交易节点接收第二交易节点返回的调用信息;所述调用信息包括N个交易节点的错误码,所述N为大于0的整数;所述第一交易节点为所述交易链路的最上层交易节点;所述第二交易节点为所述第一交易节点的下一交易节点;
    所述第一交易节点根据N个所述错误码,获取所述N个交易节点中的各个交易节点的日志信息;
    所述第一交易节点根据所述各个交易节点的日志信息,确定所述交易链路的交易调用异常的根因以及导致所述根因的目标交易节点;
    所述第一交易节点向所述目标交易节点指示所述根因,以便于所述目标交易节点根据所述根因进行链路异常的修复。
  2. 根据权利要求1所述的方法,其特征在于,所述日志信息为标准化的日志信息,所述标准化的日志信息符合日志标准格式,所述第一交易节点根据所述各个交易节点的日志信息,确定所述交易链路的交易调用异常的根因以及导致所述根因的目标交易节点,具体包括:
    所述第一交易节点根据正则表达式匹配所述标准化的日志信息,确定所述根因的第一目标位置;
    所述第一交易节点根据所述第一目标位置,提取所述交易链路的交易调用异常的根因,并根据所述根因确定导致所述根因的目标交易节点。
  3. 根据权利要求2所述的方法,其特征在于,所述第一交易节点根据正则表达式匹配所述标准化的日志信息,确定所述根因的第一目标位置,包括:
    所述第一交易节点根据所述正则表达式匹配所述标准化的日志信息中出现错误标识的各个日志段;所述各个日志段的内容为发生所述错误标识的原因;
    所述第一交易节点根据所述各个日志段的日志打印时间,将所述日志打印时间最早的日志段的所在位置,确定为所述根因的第一目标位置。
  4. 根据权利要求2所述的方法,其特征在于,所述第一交易节点根据正则表达式匹配所述标准化的日志信息,确定所述根因的第一目标位置,包括:
    所述第一交易节点根据所述正则表达式匹配所述标准化的日志信息中出现错误标识的各个日志段;所述各个日志段的内容为发生所述错误标识的原因;
    所述第一交易节点根据所述各个日志段的日志错误等级,将所述日志错误等级最高的日志段的所在位置,确定为所述根因的第一目标位置。
  5. 根据权利要求1所述的方法,其特征在于,所述错误码包括所述交易节点的标识,所述第一交易节点根据N个所述错误码,获取所述N个交易节点中的各个交易节点的日志信息,包括:
    所述第一交易节点根据所述N个所述错误码包括的N个交易节点的标识,确定出现交易调用异常的N个交易节点;
    所述第一交易节点向所述N个交易节点,获取与N个所述错误码相关的日志信息。
  6. 根据权利要求1所述的方法,其特征在于,在第二交易节点也出现交易调用异常的情况下,所述N个交易节点的错误码包括所述第二交易节点的错误码以及N-1个其他交易节点的错误码。
  7. 根据权利要求1-6任一项所述的方法,其特征在于,
    所述N个交易节点的错误码具有相同的数据格式。
  8. 根据权利要求7所述的方法,其特征在于,
    所述交易调用异常包括系统调用异常和业务调用异常,所述系统调用异常表示交易节点的硬件出现故障或操作系统出现故障导致的异常,所述业务调用异常表示交易节点的调用不满足业务需求导致的异常。
  9. 一种数据计算链路的异常处理装置,其特征在于,所述数据计算链路为交易链路,所述交易链路包括多个交易节点;所述装置包括:接收单元,获取单元,确定单元,指示单元,
    所述接收单元用于,在交易链路出现交易调用异常的情况下,接收第二交易节点返回的调用信息;所述调用信息包括N个交易节点的错误码,所述N为大于0的整数;所述第二交易节点为所述第一交易节点的下一交易节点;
    所述获取单元用于,根据N个所述错误码,获取所述N个交易节点中的各个交易节点的日志信息;
    所述确定单元用于,根据所述各个交易节点的日志信息,确定所述交易链路的交易调用异常的根因以及导致所述根因的目标交易节点;
    所述指示单元用于,向所述目标交易节点指示所述根因,以便于所述目标交易节点根据所述根因进行链路异常的修复。
  10. 根据权利要求9所述的装置,其特征在于,所述日志信息为标准化的日志信息,所述标准化的日志信息符合日志标准格式;所述确定单元进一步包括匹配单元和提取单元;
    所述匹配单元具体用于,根据正则表达式匹配所述标准化的日志信息,确定所述根因的第一目标位置;
    所述提取单元具体用于,根据所述第一目标位置,提取所述交易链路的交易调用异常的根因,并根据所述根因确定导致所述根因的目标交易节点。
  11. 根据权利要求10所述的装置,其特征在于,
    所述匹配单元具体用于,根据所述正则表达式匹配所述标准化的日志信息中出现错误标识的各个日志段;所述各个日志段的内容为发生所述错误标识的原因;根据所述各个日志段的日志打印时间,将所述日志打印时间最早的日志段的所在位置,确定为所述根因的第一目标位置。
  12. 根据权利要求10所述的装置,其特征在于,所述匹配单元具体用于:
    根据所述正则表达式匹配所述标准化的日志信息中出现错误标识的各个日志段;所述各个日志段的内容为发生所述错误标识的原因;
    根据所述各个日志段的日志错误等级,将所述日志错误等级最高的日志段的所在位置,确定为所述根因的第一目标位置。
  13. 根据权利要求9所述的装置,其特征在于,所述错误码包括所述交易节点的标识;所述获取单元具体用于:
    根据所述N个所述错误码包括的N个交易节点的标识,确定出现交易调用异常的N个交易节点;
    向所述N个交易节点,获取与N个所述错误码相关的日志信息。
  14. 根据权利要求9所述的装置,其特征在于,在第二交易节点也出现交易调用异常的情况下,所述N个交易节点的错误码包括所述第二交易节点的错误码以及N-1个其他交易节点的错误码。
  15. 一种电子设备,其特征在于,包括:
    处理器;
    用于存储处理器可执行指令的存储器;
    其中,所述处理器被配置为调用所述存储器存储的指令,对所述指令的调用使得所述处理器执行以下步骤:
    在交易链路出现交易调用异常的情况下,第一交易节点接收第二交易节点返回的调用信息;所述调用信息包括N个交易节点的错误码,所述N为大于0的整数;所述第一交易节点为所述交易链路的最上层交易节点;所述第二交易节点为所述第一交易节点的下一交易节点;
    所述第一交易节点根据N个所述错误码,获取所述N个交易节点中的各个交易节点的日志信息;
    所述第一交易节点根据所述各个交易节点的日志信息,确定所述交易链路的交易调用异常的根因以及导致所述根因的目标交易节点;
    所述第一交易节点向所述目标交易节点指示所述根因,以便于所述目标交易节点根据所述根因进行链路异常的修复。
  16. 根据权利要求15所述的电子设备,其特征在于,所述日志信息为标准化的日志信息,所述标准化的日志信息符合日志标准格式;当所述指令被所述处理器执行时,使得所述处理器具体执行以下步骤:
    根据正则表达式匹配所述标准化的日志信息,确定所述根因的第一目标位置;
    根据所述第一目标位置,提取所述交易链路的交易调用异常的根因,并根据所述根因确定导致所述根因的目标交易节点。
  17. 根据权利要求16所述的电子设备,其特征在于,当所述指令被所述处理器执行时,使得所述处理器具体执行以下步骤:
    根据所述正则表达式匹配所述标准化的日志信息中出现错误标识的各个日志段;所述各个日志段的内容为发生所述错误标识的原因;
    根据所述各个日志段的日志打印时间,将所述日志打印时间最早的日志段的所在位置,确定为所述根因的第一目标位置。
  18. 根据权利要求16所述的电子设备,其特征在于,当所述指令被所述处理器执行时,使得所述处理器具体执行以下步骤:
    根据所述正则表达式匹配所述标准化的日志信息中出现错误标识的各个日志段;所述各个日志段的内容为发生所述错误标识的原因;
    根据所述各个日志段的日志错误等级,将所述日志错误等级最高的日志段的所在位置,确定为所述根因的第一目标位置。
  19. 根据权利要求15所述的电子设备,其特征在于,所述错误码包括所述交易节点的标识;当所述指令被所述处理器执行时,使得所述处理器具体执行以下步骤:
    根据所述N个所述错误码包括的N个交易节点的标识,确定出现交易调用异常的N个交易节点;
    向所述N个交易节点,获取与N个所述错误码相关的日志信息。
  20. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行以实现权利要求1至7任意一项所述的方法。
PCT/CN2019/121692 2019-05-20 2019-11-28 基于数据计算链路的异常处理方法以及相关设备 WO2020233066A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910420339.XA CN110223173A (zh) 2019-05-20 2019-05-20 交易链路异常处理方法以及相关设备
CN201910420339.X 2019-05-20

Publications (1)

Publication Number Publication Date
WO2020233066A1 true WO2020233066A1 (zh) 2020-11-26

Family

ID=67821501

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/121692 WO2020233066A1 (zh) 2019-05-20 2019-11-28 基于数据计算链路的异常处理方法以及相关设备

Country Status (2)

Country Link
CN (1) CN110223173A (zh)
WO (1) WO2020233066A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112948207A (zh) * 2021-02-23 2021-06-11 中国工商银行股份有限公司 信息传递方法、装置、电子设备和介质
US11489717B2 (en) 2020-07-08 2022-11-01 Alipay (Hangzhou) Information Technology Co., Ltd. Method, apparatus, and electronic device for transaction link exception handling

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110223173A (zh) * 2019-05-20 2019-09-10 深圳壹账通智能科技有限公司 交易链路异常处理方法以及相关设备
CN113407370A (zh) * 2020-03-16 2021-09-17 中国移动通信有限公司研究院 根因错误的聚类方法、装置、设备及计算机可读存储介质
CN112487071A (zh) * 2020-11-17 2021-03-12 中信银行股份有限公司 一种交易查询方法、装置、电子设备及可读存储介质
CN113220540B (zh) * 2021-06-07 2023-04-25 深圳华锐分布式技术股份有限公司 业务管理方法、装置、计算机设备和存储介质
WO2023277802A2 (en) * 2021-07-01 2023-01-05 Shopee Singapore Private Limited Device and method for identifying errors in a software application
CN113778804A (zh) * 2021-09-15 2021-12-10 北京有竹居网络技术有限公司 一种日志打印方法、装置、计算机设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101309525A (zh) * 2008-06-30 2008-11-19 中兴通讯股份有限公司 一种自动交换光网络中依据故障定位的路由恢复方法
US20110205909A1 (en) * 2008-10-23 2011-08-25 Huawei Technologies Co., Ltd. Method, node and system for obtaining link aggregation group information
CN107992415A (zh) * 2017-11-28 2018-05-04 中国银联股份有限公司 一种交易系统的故障定位和分析方法及相关服务器
CN109308252A (zh) * 2017-07-27 2019-02-05 中国移动通信集团浙江有限公司 一种故障定位处理方法及装置
CN110223173A (zh) * 2019-05-20 2019-09-10 深圳壹账通智能科技有限公司 交易链路异常处理方法以及相关设备

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108933695B (zh) * 2018-06-25 2021-05-25 百度在线网络技术(北京)有限公司 用于处理信息的方法和装置
CN109766323A (zh) * 2018-12-17 2019-05-17 深圳壹账通智能科技有限公司 贷款交易全链路监控方法、装置、计算机设备和存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101309525A (zh) * 2008-06-30 2008-11-19 中兴通讯股份有限公司 一种自动交换光网络中依据故障定位的路由恢复方法
US20110205909A1 (en) * 2008-10-23 2011-08-25 Huawei Technologies Co., Ltd. Method, node and system for obtaining link aggregation group information
CN109308252A (zh) * 2017-07-27 2019-02-05 中国移动通信集团浙江有限公司 一种故障定位处理方法及装置
CN107992415A (zh) * 2017-11-28 2018-05-04 中国银联股份有限公司 一种交易系统的故障定位和分析方法及相关服务器
CN110223173A (zh) * 2019-05-20 2019-09-10 深圳壹账通智能科技有限公司 交易链路异常处理方法以及相关设备

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11489717B2 (en) 2020-07-08 2022-11-01 Alipay (Hangzhou) Information Technology Co., Ltd. Method, apparatus, and electronic device for transaction link exception handling
CN112948207A (zh) * 2021-02-23 2021-06-11 中国工商银行股份有限公司 信息传递方法、装置、电子设备和介质

Also Published As

Publication number Publication date
CN110223173A (zh) 2019-09-10

Similar Documents

Publication Publication Date Title
WO2020233066A1 (zh) 基于数据计算链路的异常处理方法以及相关设备
EP3373516B1 (en) Method and device for processing service calling information
CN110245154B (zh) 多路链接异常处理方法以及相关设备
CN104718533B (zh) 企业设备的硬件故障管理系统、方法及架构
CN107633016B (zh) 数据处理方法及装置和电子设备
CN110601880B (zh) 一种云平台、业务处理方法、命令接口及计算机设备
WO2019019640A1 (zh) 订单信息的模拟处理方法、装置、存储介质和计算机设备
US20210383371A1 (en) Method of recording transactions based on blockchain and electronic device using the same
CN110633977A (zh) 支付异常处理方法、装置及终端设备
WO2021114627A1 (zh) 基于分布式事务的数据处理方法、装置、终端及存储介质
CN111651442A (zh) 一种数据报送方法、装置、电子设备及存储介质
US11816163B2 (en) Systems and methods for improved transactional mainframes
US20140317066A1 (en) Method of analysing data
CN112866285B (zh) 网关拦截方法、装置、电子设备及存储介质
US11182375B2 (en) Metadata validation tool
US10657120B2 (en) Cross-platform digital data movement control utility and method of use thereof
CN112416784A (zh) 基于配置中心的接口校验方法、系统及装置及存储介质
CN111367776A (zh) 资源转移业务的记录方法、装置、设备及存储介质
JP2005242988A (ja) ログ情報管理システム、サービス提供システム、ログ情報管理プログラムおよびサービス提供プログラム、並びにログ情報管理方法およびサービス提供方法
CN115543837A (zh) 软件测试方法、装置、电子设备及存储介质
JP2019020864A (ja) 演算装置
CN111475400A (zh) 一种业务平台的验证方法及相关设备
CN110648219B (zh) 一种银行交易系统标准化输入区的方法和装置
US20200174875A1 (en) Secure forking of error telemetry data to independent processing units
CN112035890B (zh) 一种数据完整性验证方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19929983

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19929983

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 18.03.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 19929983

Country of ref document: EP

Kind code of ref document: A1