Method, device, non-volatile storage medium and processor for locating abnormal transactions

By analyzing the global business tracking number and sub-transaction serial number in the transaction flow number, determining the information and calling system of abnormal transactions, the problem of difficult to locate abnormal system in the existing technology is solved, and the accurate positioning and complexity of abnormal transactions is achieved. A clear description of the link.

CN114691732BActive Publication Date: 2025-02-11中国邮政储蓄银行股份有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210234282.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-09
Publication Date
2025-02-11
Estimated Expiration
2042-03-09

AI Technical Summary

Technical Problem

In the prior art, it is difficult to locate the system where the transaction flow number occurs when an abnormality occurs, and it is impossible to accurately describe the complex transaction link structure.

Method used

By obtaining the target flow number of the abnormal transaction, analyzing the global business tracking number and the sub-transaction serial number, determining the information of the abnormal transaction and the calling system, including the call initiator system of the transaction.

Benefits of technology

It realizes the accurate positioning of abnormal transaction information based on the target flow number and the calling system when an exception occurs, solving the problem that the transaction flow number is difficult to locate under abnormal circumstances.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114691732B_ABST
    Figure CN114691732B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, non-volatile storage medium and processor for locating abnormal transactions. The invention includes: when abnormal transactions are detected in multiple transactions, obtaining the target serial number corresponding to the abnormal transaction; locating the abnormal transaction according to the target serial number, determining the information of the abnormal transaction and the corresponding calling system when the abnormality occurs, and the calling system includes the initiator system of the transaction call and the called system. In this method, the target serial number of the abnormal transaction obtained is unique, and a transaction can be uniquely located, and each system called by the transaction link can be described, so the information of the abnormal transaction and the calling system when the abnormality occurs can be located according to the target serial number, so that the system where the abnormality occurs can be located according to the target serial number, thereby solving the technical problem in the related art that it is difficult to locate the system where the abnormality occurs when the transaction serial number occurs abnormally.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and in particular to a method, device, non-volatile storage medium and processor for locating abnormal transactions. Background Art

[0002] At present, banks have a wide variety of business types and rich business scenarios. They process thousands of transactions every day, and one transaction often involves multiple systems. When an abnormality occurs in a transaction, it is necessary to locate the abnormal transaction and to know in which system call process the abnormality occurred in the transaction. Therefore, transaction positioning and transaction link tracking are particularly important in banking transactions.

[0003] In existing banking services, serial numbers are usually used to record and track a transaction. Current technology is already able to generate globally unique serial numbers. The more mature solutions currently include the Snowflake algorithm. This solution is an algorithm that generates IDs by dividing the namespace. It uses binary to represent a total of 64 bits, which are divided into multiple segments to mark machines, time, etc. The first part is 1-bit, representing the sign bit; the second part is 41-bit, used to record the timestamp, which is in milliseconds and can represent 69 years; the third part is 10-bit, representing the machine ID, used to record the working machine number; the fourth part is 12-bit, representing the serial number, used to record different IDs generated in the same millisecond.

[0004] Although the serial number can uniquely locate a transaction, it lacks a specific description of the systems involved in the transaction. Once an abnormality occurs in a transaction, it will be very difficult for operation and maintenance personnel to locate the system where the abnormality occurred based only on the serial number.

[0005] In addition, the existing codes that can describe transaction link information can only describe simple system call relationships, such as "A->B->C". However, many transactions in banking business involve complex links, and the call relationship often has multiple sub-branches. Such link structures still require accurate and clear coding methods to express.

[0006] Regarding the problem in the related art that when an abnormality occurs in a transaction, it is difficult to locate the system where the abnormality occurs, and no effective solution has been proposed yet. Summary of the invention

[0007] The main purpose of the present invention is to provide a method, device, non-volatile storage medium and processor for locating abnormal transactions, so as to solve the problem in the related art that when an abnormal transaction occurs, it is difficult to locate the system where the abnormality occurs.

[0008] In order to achieve the above-mentioned purpose, according to one aspect of the present invention, a method for locating abnormal transactions is provided. The invention comprises: when an abnormal transaction is detected among multiple transactions, obtaining a target serial number corresponding to the abnormal transaction; locating the abnormal transaction according to the target serial number to determine the information of the abnormal transaction and the corresponding calling system when the abnormal transaction occurs abnormally in the transaction link, wherein the calling system includes the calling initiator system of the transaction.

[0009] Furthermore, when an abnormal transaction is detected among multiple transactions, a target serial number corresponding to the abnormal transaction is obtained, including: when an abnormal transaction is detected among multiple transactions, a current message generated by the abnormal transaction during the transaction process is obtained; and the target serial number contained in the message is obtained, wherein the target serial number includes a global business tracking number corresponding to the abnormal transaction and a sub-transaction sequence number corresponding to the abnormal transaction, and the global business tracking number runs through the entire transaction process corresponding to the abnormal transaction.

[0010] Further, the abnormal transaction is located according to the target serial number to determine the information of the abnormal transaction, including: parsing the global business tracking number and obtaining a first parsing result, wherein the first parsing result at least includes a timestamp, a first system number, a first transaction instance number and a serial number, the timestamp is the timestamp corresponding to the abnormal transaction when the transaction is initiated, the first system number is an identification code corresponding to the original initiator system of the abnormal transaction, the first transaction instance number is an identification code of the machine where the transaction instance corresponding to the abnormal transaction is located, and the serial number is a cyclically increasing serial number generated by the original initiator system when the abnormal transaction is initiated; based on the first parsing result, the information of the abnormal transaction is determined.

[0011] Furthermore, before locating the abnormal transaction according to the target serial number to determine the information of the abnormal transaction, the method also includes: obtaining the MAC address corresponding to the machine where the original transaction instance corresponding to the abnormal transaction is located; calculating the hash value corresponding to the MAC address, and performing a modulo operation on the hash value to obtain a modulo result; and performing a zero-filling operation on the modulo result to obtain the first transaction instance serial number.

[0012] Furthermore, the abnormal transaction is located according to the target serial number to determine the calling system corresponding to the abnormal transaction when the abnormality occurs in the transaction link, including: obtaining the target sub-transaction sequence number contained in the target serial number, wherein the target sub-transaction sequence number is the current sub-transaction sequence number generated by the abnormal transaction during the transaction process; parsing the target sub-transaction sequence number and obtaining a second parsing result, wherein the second parsing result at least includes a second system number, a second transaction instance sequence number and a latest transaction arrangement number, the second system number is an identification code corresponding to the current calling initiator system corresponding to the abnormal transaction, the second transaction instance sequence number is an identification code of the machine where the transaction instance corresponding to the current calling initiator system is located, and the latest transaction arrangement number represents the calling link of the system in the current calling process from both horizontal and vertical dimensions; based on the second parsing result, determining the calling system corresponding to the abnormal transaction when the abnormality occurs in the transaction link.

[0013] Furthermore, before locating the abnormal transaction based on the target serial number to determine the corresponding calling system when the abnormal transaction occurs in the transaction link, the method includes: obtaining current system call information corresponding to the abnormal transaction in the transaction link, the current system call information at least including information of the current calling initiator system and the current called system corresponding to the abnormal transaction; generating the target sub-transaction sequence number based on the current system call information.

[0014] Further, based on the current system call information, the target sub-transaction serial number is generated, including: obtaining an identification code corresponding to the current call initiator system, and determining the identification code as the prefix of the target sub-transaction serial number; determining the level of the transaction link where the current system is located, and determining the number corresponding to the level of the transaction link; arranging the prefix and the number in sequence, and determining that the characters other than the prefix and the level number are 0, so as to generate a reference serial number corresponding to the target sub-transaction serial number; obtaining the call status of the current call initiator system calling the current called system, and adjusting the reference serial number according to the call status; determining the adjusted reference serial number as the target sub-transaction serial number.

[0015] Furthermore, the calling situation of the current calling initiator system calling the currently called system is obtained, and the base sequence number is adjusted according to the calling situation, including: judging whether the current calling initiator system is calling an external system for the first time when calling the currently called system; if the current calling initiator system is calling the external system for the first time, upgrading the base sequence number so that the first character of the base sequence number whose first position is 0 is converted to 1; if the current calling initiator system is not calling the external system for the first time, upgrading the base sequence number to adjust the level number in the base sequence number by 1.

[0016] In order to achieve the above-mentioned purpose, according to another aspect of the present invention, a device for locating abnormal transactions is provided. The device comprises: an acquisition unit, which is used to acquire a target serial number corresponding to the abnormal transaction when an abnormal transaction is detected among multiple transactions; a positioning unit, which is used to locate the abnormal transaction according to the target serial number, so as to determine the information of the abnormal transaction and the corresponding calling system when the abnormal transaction occurs abnormally in the transaction link, and the calling system includes the calling initiator system of the transaction.

[0017] In order to achieve the above-mentioned object, according to another aspect of the present invention, a non-volatile storage medium is provided, wherein the non-volatile storage medium includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute any one of the methods described.

[0018] In order to achieve the above objective, according to another aspect of the present invention, a processor is provided, wherein the processor is used to run a program, wherein the program executes any one of the methods when running.

[0019] Through the present invention, first, when an abnormal transaction is detected in multiple transactions, the target serial number corresponding to the abnormal transaction is obtained, and then the abnormal transaction is located according to the target serial number, and the information of the abnormal transaction and the corresponding calling system when the abnormality occurs are determined, and the calling system includes the initiator system of the transaction call and the called system. In this method, the target serial number of the abnormal transaction obtained is unique, and a transaction can be uniquely located, and each system called by the transaction link can be described, so the information of the abnormal transaction and the calling system when the abnormality occurs can be located according to the target serial number, so that the system where the abnormality occurs can be located according to the target serial number, thereby solving the technical problem that the transaction serial number in the related art is difficult to locate the system where the abnormality occurs when the transaction is abnormal. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:

[0021] Figure 1 is a flow chart of a method for locating abnormal transactions provided according to an embodiment of the present invention;

[0022] Figure 2 is a schematic diagram of a device for locating abnormal transactions according to an embodiment of the present invention;

[0023] Figure 3 is a flow chart of generating a transaction instance serial number according to an embodiment of the present invention;

[0024] Figure 4 is a flowchart of sequence number generation provided according to an embodiment of the present invention;

[0025] Figure 5 is a schematic diagram of a transaction link provided according to an embodiment of the present invention;

[0026] Figure 6 is a flow chart of generating a transaction instance serial number according to an embodiment of the present invention;

[0027] Figure 7 is a schematic diagram of a transaction link provided according to an embodiment of the present invention;

[0028] Figure 8 is a flowchart of the layer upgrade logic provided according to an embodiment of the present invention;

[0029] Fig. 9 is a flowchart of the upgrade logic provided according to an embodiment of the present invention. DETAILED DESCRIPTION

[0030] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0031] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention 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 data used in this way can be interchanged where appropriate, so as to describe the embodiments of the present invention described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0033] As mentioned in the background technology, when an abnormal transaction occurs, it is difficult to locate the system where the abnormality occurs using the transaction serial number in the related technology. In order to solve the above problem, in a typical embodiment of the present application, a method, device, non-volatile storage medium and processor for locating abnormal transactions are provided.

[0034] According to an embodiment of the present invention, a method for locating abnormal transactions is provided.

[0035] Figure 1 1 is a flow chart of a method for locating abnormal transactions according to an embodiment of the present invention. Figure 1 As shown, the invention comprises the following steps:

[0036] Step S101, when an abnormal transaction is detected among multiple transactions, obtaining a target serial number corresponding to the abnormal transaction;

[0037] Step S102, locating the abnormal transaction according to the target serial number to determine the information of the abnormal transaction and the corresponding calling system when the abnormal transaction occurs in the transaction link, wherein the calling system includes the calling initiator system of the transaction.

[0038] In the above method, first, when an abnormal transaction is detected among multiple transactions, the target serial number corresponding to the abnormal transaction is obtained, and then the abnormal transaction is located according to the target serial number, and the information of the abnormal transaction and the corresponding calling system when the abnormality occurs are determined, and the calling system includes the initiator system of the transaction call and the called system. In this method, the target serial number of the abnormal transaction obtained is unique, and a transaction can be uniquely located, and each system called by the transaction link can be described. Therefore, the information of the abnormal transaction and the calling system when the abnormality occurs can be located according to the target serial number, so that the system where the abnormality occurs can be located according to the target serial number, thereby solving the technical problem in the related art that it is difficult to locate the system where the abnormality occurs when the transaction serial number is abnormal.

[0039] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0040] In one embodiment of the present application, when an abnormal transaction is detected among multiple transactions, the target serial number corresponding to the abnormal transaction is obtained, including: when an abnormal transaction is detected among multiple transactions, the current message generated by the abnormal transaction during the transaction process is obtained; the target serial number contained in the message is obtained, wherein the target serial number includes the global business tracking number corresponding to the abnormal transaction and the sub-transaction sequence number corresponding to the abnormal transaction, and the global business tracking number runs through the entire transaction process corresponding to the abnormal transaction. When making a cross-system call, a standard public message will be used to record the key fields required for the transaction. The target serial number belongs to the key field that needs to be recorded, so the target serial number can be obtained from the current message. The target serial number includes the global business tracking number and the sub-transaction sequence number that run through the entire transaction process of the abnormal transaction. This embodiment does not need to generate a new target serial number, but directly obtains it from the current message, thereby realizing a system for quickly locating transaction anomalies.

[0041] In order to obtain accurate information about abnormal transactions, in another embodiment of the present application, the abnormal transaction is located according to the target serial number to determine the information about the abnormal transaction, including: parsing the global business tracking number and obtaining a first parsing result, wherein the first parsing result at least includes a timestamp, a first system number, a first transaction instance number and a sequence number, the timestamp is the timestamp corresponding to the abnormal transaction when the transaction is initiated, the first system number is the identification code corresponding to the original initiator system of the abnormal transaction, the first transaction instance number is the identification code of the machine where the transaction instance corresponding to the abnormal transaction is located, and the sequence number is the cyclically increasing sequence number generated by the original initiator system when the abnormal transaction is initiated; and the information about the abnormal transaction is determined according to the first parsing result. The global business tracking number is generated by the trigger point and lasts until the time is completely over, so the global business tracking number records the information about the abnormal transaction. Therefore, in this embodiment, the global business tracking number needs to be parsed first to obtain the first parsing result, and the information about the abnormal transaction recorded in the global business tracking number can be obtained according to the first parsing result.

[0042] The global business tracking number may be used as a database primary key in the system. For the database primary key, the primary key length is required not to be too long. In addition, considering that the global business tracking number has many components, in a specific embodiment of the present application, the global business tracking number is set to 32 bits. The composition of the global business tracking number is shown in Table 1:

[0043] Table 1

[0044]

[0045] The above timestamp is generated by obtaining the local system time and belongs to the technical field.

[0046] The above system number: All systems are arranged according to the division of business functions. It is a code with business attributes. This part consists of 7 digits and is derived from a unified standard. For example, the deposit system uses "1111111" and the remittance system uses "2222222". The system number in the global business tracking number is generated by the transaction initiator.

[0047] The above transaction instance serial number: This component belongs to the technical field. The generation process is as follows Figure 3 As shown, when initiating the acquisition of the transaction instance serial number, it is first obtained from the local environment variable. The above environment variable is an environment parameter configured in the server. If it exists, it is directly returned. If it does not exist, it is obtained from the system startup parameters. If the transaction instance serial number configuration exists in the startup parameters, it is directly returned. If it does not exist, it is generated by the local default algorithm. The transaction instance serial number in the global business tracking number is generated by the transaction initiator.

[0048] Generation of the above serial number: In this application, the serial number is used cyclically, and the generation process is as follows Figure 4 As shown. The serial number uses Java's native AtomicInteger to increment itself. After incrementing, the result is judged whether it is greater than 999999. If it is, the serial number is set to 1 and formatted as a string. If it is not greater than 999999, the result is formatted as a string to generate the final serial number.

[0049] The generated global business tracking number is obtained by concatenating the 14-digit timestamp, 7-digit system code, 5-digit transaction instance number and 6-digit serial number. Figure 5 As shown in the figure below, suppose there is a transaction, and its transaction link is shown in the figure below. System A is the initiator of the transaction, and system A generates the global business tracking number for this transaction. System B and system C will not generate global business tracking numbers. Each call between systems in the transaction will send the global business tracking number to the downstream system.

[0050] In another embodiment of the present application, Figure 6 As shown, before locating the abnormal transaction according to the target serial number to determine the information of the abnormal transaction, the method further includes: obtaining the MAC address corresponding to the machine where the original transaction instance corresponding to the abnormal transaction is located; calculating the hash value corresponding to the MAC address, and performing a modulo operation on the hash value to obtain a modulo result; and performing a zero padding operation on the modulo result to obtain the first transaction instance serial number. In this embodiment, the hash value is calculated by the MAC address of the machine where the original transaction instance is located, and then a modulo operation is performed on the hash value, and finally a zero padding operation is performed on the result of the modulo operation, so as to obtain an accurate first transaction instance serial number.

[0051] For example, if the transaction instance number is 5 digits, then 99999 (5 9s) is taken modulo, and if the transaction instance number is 6 digits, then 999999 (6 9s) is taken modulo. Finally, the modulo result is string formatted (i.e., zero-filled) to complete the generation of the transaction instance number.

[0052] In addition, the method for determining the first transaction instance serial number also includes obtaining it from the configuration parameters of the service startup and obtaining it from the environment variable configuration.

[0053] In another embodiment of the present application, the abnormal transaction is located according to the target serial number to determine the calling system corresponding to the abnormal transaction when the abnormality occurs in the transaction link, including: obtaining the target sub-transaction sequence number from the multiple sub-transaction sequence numbers contained in the target serial number, wherein the target sub-transaction sequence number is the current sub-transaction sequence number generated by the abnormal transaction during the transaction process; parsing the target sub-transaction sequence number and obtaining a second parsing result, wherein the second parsing result at least includes a second system number, a second transaction instance sequence number and a latest transaction arrangement number, the second system number is an identification code corresponding to the current calling initiator system corresponding to the abnormal transaction, the second transaction instance sequence number is an identification code of the machine where the transaction instance corresponding to the abnormal transaction generated by the current calling initiator system is located, and the latest transaction arrangement number represents the calling link of the system in the current calling process from both horizontal and vertical dimensions; based on the second parsing result, determining the calling system corresponding to the abnormal transaction when the abnormality occurs in the transaction link. In this embodiment, it is necessary to first obtain the second system number, the second transaction instance number and the latest transaction arrangement number for the above-mentioned target sub-transaction number. The calling initiating system of the abnormal transaction and the transaction link of the calling process can be located through the above-mentioned second system number, the above-mentioned second transaction instance number and the above-mentioned latest transaction arrangement number, thereby realizing the rapid positioning of the abnormal calling system in the complex link.

[0054] The target sub-transaction serial number includes the second system number, the second transaction instance serial number and the latest transaction arrangement number. The target sub-transaction serial number is mainly used to identify each calling sub-branch of a transaction. The composition of the target sub-transaction serial number is shown in Table 2:

[0055] Table 2

[0056]

[0057] The second system number is different from the system number in the global service tracking number in that the second system number is generated by the current call initiator system.

[0058] The method for generating the above transaction instance serial number is consistent with the method for generating the above global business tracking number, but the difference is that the transaction instance serial number is generated by the call initiator system.

[0059] The above latest transaction arrangement number consists of letters and numbers. The latest transaction arrangement number has a total of 20 digits, indicating that the transaction level number supports a maximum of 20 layers. The character value range of each digit in the latest transaction arrangement number is "1-9, AZ", indicating that the maximum number of transaction instances at the same level supports 35. The latest transaction arrangement number represents the call link of the transaction from both horizontal and vertical dimensions, and the latest transaction arrangement number is passed back along the transaction link. The initial value of the latest transaction arrangement number is all 0. Every time a system call occurs on the transaction link, the latest transaction arrangement number will perform the logic of upgrading the layer or upgrade.

[0060] In another embodiment of the present application, before locating the abnormal transaction according to the target serial number to determine the corresponding calling system when the abnormal transaction occurs in the transaction link, the method includes: obtaining the current system calling information corresponding to the abnormal transaction in the transaction link, the current system calling information at least includes the information of the current calling initiator system and the current called system corresponding to the abnormal transaction; generating the target sub-transaction sequence number according to the current system calling information. In this embodiment, the target sub-transaction sequence number is generated according to the calling information of the current system, so the system where the abnormal transaction occurs can be located according to the target sub-transaction sequence number, thereby locating the abnormal calling system more quickly.

[0061] In a specific embodiment of the present application, after receiving a message transmitted by an upstream system, the sub-transaction sequence number in the message will be stored in a custom context, and the custom context is implemented using the JAVA native ThreadLocal class. ThreadLocal is a storage class within a thread that can store data within a specified thread. After the data is stored, only the specified thread can obtain the stored data. ThreadLocal uses a separate storage space for each thread, which has the effect of thread isolation. The corresponding value can only be obtained within the thread, and the desired value cannot be accessed outside the thread. Therefore, the current thread conducting the transaction can obtain the sub-transaction sequence number transmitted from the upstream system to this system through the custom context.

[0062] A stack data structure is created in the custom context. This structure is used to store newly generated sub-transaction numbers, which are recorded as sub-transaction number stacks. The number of sub-transaction numbers stored in the stack is 0 at the beginning. Each time a new sub-transaction number is generated, the sub-transaction number is pushed into the stack. The top element of the stack is always the latest sub-transaction number. It should be noted that there are two attributes in the custom context to store sub-transaction numbers, which are recorded as subTxNo and subTxNoStack in this application. The difference between the two attributes is shown in Table 3 below.

[0063] Table 3

[0064]

[0065]

[0066] When the sub-transaction number needs to be upgraded, it is mainly judged by whether the number of elements in the sub-transaction number stack subTxNoStack is 0. If it is 0, it means that the current system has not generated a sub-transaction number, indicating that the current system is calling the external system for the first time, and the logic of upgrading is performed. When upgrading, it is necessary to take out the sub-transaction number subTxNo transmitted from the upstream system to this system from the custom context, and use it as a reference to complete the logic of upgrading the sub-transaction number in the above section, and finally push the newly generated sub-transaction number into the sub-transaction number stack subTxNoStack of the custom context.

[0067] When the sub-transaction sequence number is upgraded, it is also judged by whether the number of elements in the sub-transaction sequence number stack subTxNoStack is 0. If it is not 0, it means that the current system has generated a sub-transaction sequence number, which means that the current system is not calling the external system for the first time, and the upgrade logic is performed. When upgrading, it is necessary to obtain the sub-transaction sequence number at the top of the stack from the sub-transaction sequence number stack subTxNoStack, and use the sub-transaction sequence number as the basis to complete the logic of upgrading the sub-transaction sequence number in the above section, and finally push the newly generated sub-transaction sequence number into the sub-transaction sequence number stack subTxNoStack.

[0068] When the calling system needs to generate a sub-transaction sequence number, the top element of the sub-transaction sequence number stack of the custom context is returned to the system.

[0069] In another embodiment of the present application, the target sub-transaction serial number is generated based on the current system call information, including: obtaining an identification code corresponding to the current call initiator system, and determining the identification code as a prefix of the target sub-transaction serial number; generating the target sub-transaction serial number to obtain the transaction instance serial number; determining the level of the transaction link in which the current system is located, and determining the level number corresponding to the level; arranging the prefix and the level number in sequence, and determining that the characters other than the prefix and the level number are 0, to generate a reference number corresponding to the target sub-transaction serial number; obtaining a call status of the current call initiator system calling the current called system, and adjusting the reference number based on the call status; determining the adjusted reference number as the target sub-transaction serial number. In this embodiment, the prefix of the calling initiator system and the level number of the exchange are first determined, and then the number of characters in the target sub-transaction serial number is determined. The above prefix and the above level number are arranged in sequence, and the characters other than the above prefix and the above level number are determined to be 0, thereby generating a target sub-transaction serial number. In this way, the calling initiator system can be quickly located from the generated target sub-transaction serial number through the prefix, and according to the level number, it can be located how many times the call has been made, thereby more quickly locating the system where the abnormality has occurred.

[0070] The specific process of generating the target sub-transaction number is as follows: Figure 7 Taking the transaction link shown as an example, this link focuses on the generation process of the latest transaction arrangement number. The system number and transaction instance number in the sub-transaction sequence number are uniformly represented by corresponding placeholders. For example, system A uses the letter "A" to represent its system number and transaction instance number, system B uses the letter "B" to represent its system number and transaction instance number, and so on.

[0071] (1) System A, as the transaction initiator, generates the first sub-transaction number of this transaction, which is "A10000000000000000000". System A, as the transaction initiator, has a transaction level number of 1, so the first digit of its corresponding latest transaction number is 1, and the last 19 digits are all 0;

[0072] (2) System A first calls system B, then calls system C, and then calls system D.

[0073] At this time, three new sub-transaction numbers need to be generated to represent these three call branches. The system number and transaction instance number in the three sub-transaction numbers are all generated by system A, so the prefix of the sub-transaction numbers is A. The first time, system A calls system B, which is the first time that system A calls an external system, so the logic of upgrading is required. Taking the first sub-transaction number "A1000000000000000000" as the benchmark, according to the above logic of upgrading, the sub-transaction number obtained is "A11000000000000000000"; the second time, system A calls system C, which is not the first time that system A calls an external system, so the logic of upgrading is required, and the previous sub-transaction number "A1100000000000000000" is used as the benchmark. 000000000000000" is taken as the benchmark, according to the upgrading logic, the obtained sub-transaction number is "A12000000000000000000"; the third time, system A calls D, which is not the first time that system A calls an external system, so it is necessary to perform upgrading logic, taking the previous sub-transaction number "A12000000000000000000" as the benchmark, according to the upgrading logic, the obtained sub-transaction number is "A13000000000000000000".

[0074] (3) System B calls System E, and System B calls System F. At this time, two new sub-transaction numbers need to be generated to represent the two calling sub-branches. The system number and transaction instance number in the two sub-transaction numbers are both generated by System B. The first time, System B calls System E, which is System B's first call to an external system, so it is necessary to perform the logic of upgrading. The previous sub-transaction number "A11000000000000000000" is used as the basis. According to the logic of upgrading, the sub-transaction number generated is "B11100000000000000000"; the second time, System B calls System F, which is not System B's first call to an external system, so it is necessary to perform the logic of upgrading. The previous sub-transaction number "B111000000000000000000 is used as the basis. According to the logic of upgrading, the sub-transaction number obtained is "B11200000000000000000".

[0075] (4) System D calls system G. At this time, a new sub-transaction number needs to be generated to represent this calling sub-branch. The system number and transaction instance number of this sub-transaction number are generated by system D. System D calls system G, which is the first time that system D calls an external system. Therefore, the logic of upgrading is required. Based on the previous sub-transaction number "A13000000000000000000", according to the logic of upgrading, the sub-transaction number obtained is "D13100000000000000000". At this point, the latest transaction arrangement number generation process of this transaction link has been completed.

[0076] Taking the target sub-transaction number "D13100000000000000000" generated above as an example, we can first know that the system caller is system D; in the last 20 digits of the latest transaction arrangement number, there are 3 non-0 characters, which indicates that the transaction level number of the current system in the transaction chain is 3; find the position where the character 0 first appears from left to right in the latest transaction arrangement number, recorded as pos, and the character corresponding to the position where pos minus one is "1", indicating that the current system is the first system called by system D.

[0077] In order to locate the abnormal system more quickly, in another embodiment of the present application, the calling situation of the current calling initiator system calling the current called system is obtained, and the reference sequence number is adjusted according to the calling situation, including: judging whether the current calling initiator system is calling the external system for the first time when calling the current called system; if the current calling initiator system is calling the external system for the first time, upgrading the reference sequence number so that the first character of the reference sequence number that is 0 is converted to 1; if the current calling initiator system is not calling the external system for the first time, upgrading the reference sequence number to adjust the level number in the reference sequence number by 1. In this embodiment, the upgrading logic or upgrading logic is performed according to whether the calling initiator system is calling the external system for the first time, so that the calling situation of the current system can be obtained according to the first bit and the level number in the reference sequence number.

[0078] In a specific embodiment of the present application, the above-mentioned upgrade logic is as follows: Figure 8 As shown, it is necessary to find the first position where the character 0 appears from left to right in the latest transaction arrangement number. If the position exists, change the character 0 to 1 to complete the upgrade logic of the latest transaction arrangement number. If the position does not exist, it means that the transaction level number has reached the maximum and cannot be upgraded further.

[0079] In another specific embodiment of the present application, the above-mentioned upgrading logic is as follows Fig. 9As shown, first find the first position of character 0 from left to right in the latest transaction arrangement number, recorded as pos. If pos exists, get the character at position pos minus 1, and then determine whether the character is Z. Count and perform base operation. If it is Z, it means that the number of transaction instances at the same level has reached the maximum. If it is not Z, the character is incremented. It should be noted that when the character is 9, the result after increment is A. If pos does not exist, get the last character in the latest transaction arrangement number, and then determine whether the character is Z. The subsequent steps are the same as the previous steps.

[0080] The embodiment of the present invention further provides a device for locating abnormal transactions. It should be noted that the device for locating abnormal transactions in the embodiment of the present invention can be used to execute the method for locating abnormal transactions provided in the embodiment of the present invention. The device for locating abnormal transactions provided in the embodiment of the present invention is introduced below.

[0081] Figure 2 Schematic diagram of a device for locating abnormal transactions according to an embodiment of the present invention. Figure 2 As shown, the device comprises:

[0082] The first acquisition unit 10 is used to acquire a target serial number corresponding to an abnormal transaction when an abnormal transaction is detected among multiple transactions;

[0083] The positioning unit 20 is used to locate the abnormal transaction according to the target serial number to determine the information of the abnormal transaction and the corresponding calling system when the abnormal transaction occurs abnormally in the transaction link, and the calling system includes the calling initiator system of the transaction.

[0084] The above-mentioned device includes a first acquisition unit and a positioning unit. The acquisition unit is used to acquire the target serial number corresponding to the abnormal transaction when an abnormal transaction is detected in multiple transactions. The positioning unit is used to locate the abnormal transaction according to the target serial number, determine the information of the abnormal transaction and the corresponding calling system when the abnormality occurs, and the calling system includes the initiator system and the called system of the transaction call. In the device, the target serial number of the abnormal transaction obtained is unique, and a transaction can be uniquely located, and each system called by the transaction link can be described. Therefore, the information of the abnormal transaction and the calling system when the abnormality occurs can be located according to the target serial number, so that the system where the abnormality occurs can be located according to the target serial number, thereby solving the technical problem in the related art that it is difficult to locate the system where the abnormality occurs when the transaction serial number is abnormal.

[0085] In one embodiment of the present application, the first acquisition unit includes a first acquisition subunit and a second acquisition subunit, wherein the first acquisition subunit is used to acquire the current message generated by the abnormal transaction in the transaction process when an abnormal transaction is detected in multiple transactions; the second acquisition subunit is used to acquire the target serial number contained in the message, wherein the target serial number includes the global business tracking number corresponding to the abnormal transaction and the sub-transaction sequence number corresponding to the abnormal transaction, and the global business tracking number runs through the entire transaction process corresponding to the abnormal transaction. When making a cross-system call, a standard public message will be used to record the key fields required for the transaction. The target serial number belongs to the key field that needs to be recorded, so the target serial number can be obtained from the current message. The target serial number includes the global business tracking number and the sub-transaction sequence number that run through the entire transaction process of the abnormal transaction. This embodiment does not need to generate a new target serial number, but directly obtains it from the current message, thereby realizing a system for quickly locating transaction anomalies.

[0086] In order to obtain accurate information about abnormal transactions, in another embodiment of the present application, the positioning unit includes a first parsing subunit and a first determining subunit, wherein the first parsing subunit is used to parse the global business tracking number and obtain a first parsing result, wherein the first parsing result at least includes a timestamp, a first system number, a first transaction instance number and a sequence number, wherein the timestamp is the timestamp corresponding to the abnormal transaction when the transaction is initiated, the first system number is the identification code corresponding to the original initiator system of the abnormal transaction, the first transaction instance number is the identification code of the machine where the transaction instance corresponding to the abnormal transaction is located, and the sequence number is the cyclically increasing sequence number generated by the original initiator system when the abnormal transaction is initiated; the first determining subunit is used to determine the information about the abnormal transaction based on the first parsing result. The global business tracking number is generated by the trigger point and lasts until the time is completely over, so the global business tracking number records the information about the abnormal transaction, so in this embodiment, the global business tracking number needs to be parsed first to obtain the first parsing result, and the information about the abnormal transaction recorded in the global business tracking number can be obtained according to the first parsing result.

[0087] The global business tracking number may be used as a database primary key in the system. For the database primary key, the primary key length is required not to be too long. In addition, considering that the global business tracking number has many components, in a specific embodiment of the present application, the global business tracking number is set to 32 bits. The composition of the global business tracking number is shown in Table 1:

[0088] Table 1

[0089]

[0090] The above timestamp is generated by obtaining the local system time and belongs to the technical field.

[0091] The above system number: All systems are arranged according to the division of business functions. It is a code with business attributes. This part consists of 7 digits and is derived from a unified standard. For example, the deposit system uses "1111111" and the remittance system uses "2222222". The system number in the global business tracking number is generated by the transaction initiator.

[0092] The above transaction instance serial number: This component belongs to the technical field. The generation process is as follows Figure 3 As shown, when initiating the acquisition of the transaction instance serial number, it is first obtained from the local environment variable. The above environment variable is an environment parameter configured in the server. If it exists, it is directly returned. If it does not exist, it is obtained from the system startup parameters. If the transaction instance serial number configuration exists in the startup parameters, it is directly returned. If it does not exist, it is generated by the local default algorithm. The transaction instance serial number in the global business tracking number is generated by the transaction initiator.

[0093] Generation of the above serial number: In this application, the serial number is used cyclically, and the generation process is as follows Figure 4 As shown. The serial number uses Java's native AtomicInteger to increment itself. After incrementing, the result is judged whether it is greater than 999999. If it is, the serial number is set to 1 and formatted as a string. If it is not greater than 999999, the result is formatted as a string to generate the final serial number.

[0094] The generated global business tracking number is obtained by concatenating the 14-digit timestamp, 7-digit system code, 5-digit transaction instance number and 6-digit serial number. Figure 5 As shown in the figure below, suppose there is a transaction, and its transaction link is shown in the figure below. System A is the initiator of the transaction, and system A generates the global business tracking number for this transaction. System B and system C will not generate global business tracking numbers. Each call between systems in the transaction will send the global business tracking number to the downstream system.

[0095] In another embodiment of the present application, Figure 6As shown, the device further includes a second acquisition unit, a first calculation unit, and a second calculation unit, wherein the second acquisition unit is used to locate the abnormal transaction according to the target serial number to determine the information of the abnormal transaction, and then obtain the MAC address corresponding to the machine where the original transaction instance corresponding to the abnormal transaction is located; the first calculation unit is used to calculate the hash value corresponding to the MAC address, and perform a modulo operation on the hash value to obtain a modulo result; the second calculation unit is used to perform a zero-filling operation on the modulo result to obtain the first transaction instance serial number. In this embodiment, the hash value is calculated by the MAC address of the machine where the original transaction instance is located, and then the hash value is subjected to a modulo operation, and finally the result of the modulo operation is subjected to a zero-filling operation, so as to obtain an accurate first transaction embodiment serial number.

[0096] For example, if the transaction instance number is 5 digits, then 99999 (5 9s) is taken modulo, and if the transaction instance number is 6 digits, then 999999 (6 9s) is taken modulo. Finally, the modulo result is string formatted (i.e., zero-filled) to complete the generation of the transaction instance number.

[0097] In another embodiment of the present application, the positioning unit includes a third acquisition subunit, a second parsing subunit and a second determination subunit, wherein the third acquisition subunit is used to acquire a target sub-transaction sequence number from the multiple sub-transaction sequence numbers contained in the target serial number, wherein the target sub-transaction sequence number is a current sub-transaction sequence number generated by the abnormal transaction during the transaction process; the second parsing subunit is used to parse the target sub-transaction sequence number and obtain a second parsing result, wherein the second parsing result at least includes a second system number, a second transaction instance sequence number and a latest transaction arrangement number, the second system number is an identification code corresponding to the current call initiator system corresponding to the abnormal transaction, the second transaction instance sequence number is an identification code of a machine where the transaction instance corresponding to the abnormal transaction generated by the current call initiator system is located, and the latest transaction arrangement number represents a call link to the system in the current call process from both horizontal and vertical dimensions; the second determination subunit is used to determine, based on the second parsing result, a corresponding calling system of the abnormal transaction when an abnormality occurs in the transaction link. In this embodiment, it is necessary to first obtain the second system number, the second transaction instance number and the latest transaction arrangement number for the above-mentioned target sub-transaction number. The calling initiating system of the abnormal transaction and the transaction link of the calling process can be located through the above-mentioned second system number, the above-mentioned second transaction instance number and the above-mentioned latest transaction arrangement number, thereby realizing the rapid positioning of the abnormal calling system in the complex link.

[0098] The target sub-transaction serial number includes the second system number, the second transaction instance serial number and the latest transaction arrangement number. The target sub-transaction serial number is mainly used to identify each calling sub-branch of a transaction. The composition of the target sub-transaction serial number is shown in Table 2:

[0099] Table 2

[0100]

[0101] The second system number is different from the system number in the global service tracking number in that the second system number is generated by the current call initiator system.

[0102] The method for generating the above transaction instance serial number is consistent with the method for generating the above global business tracking number, but the difference is that the transaction instance serial number is generated by the call initiator system.

[0103] The above latest transaction arrangement number consists of letters and numbers. The latest transaction arrangement number has a total of 20 digits, indicating that the transaction level number supports a maximum of 20 layers. The character value range of each digit in the latest transaction arrangement number is "1-9, AZ", indicating that the maximum number of transaction instances at the same level supports 35. The latest transaction arrangement number represents the call link of the transaction from both horizontal and vertical dimensions, and the latest transaction arrangement number is passed back along the transaction link. The initial value of the latest transaction arrangement number is all 0. Every time a system call occurs on the transaction link, the latest transaction arrangement number will perform the logic of upgrading the layer or upgrade.

[0104] In another embodiment of the present application, the device includes a third acquisition unit and a generation unit, wherein the third acquisition unit is used to locate the abnormal transaction according to the target serial number to determine the corresponding calling system when the abnormal transaction occurs in the transaction link, and obtain the current system call information corresponding to the abnormal transaction in the transaction link, wherein the current system call information at least includes the information of the current calling initiator system and the current called system corresponding to the abnormal transaction; the generation unit is used to generate the target sub-transaction sequence number according to the current system call information. In this embodiment, the target sub-transaction sequence number is generated according to the calling information of the current system, so the system where the abnormal transaction occurs can be located according to the target sub-transaction sequence number, thereby locating the abnormal calling system more quickly.

[0105] In a specific embodiment of the present application, after receiving a message transmitted by an upstream system, the sub-transaction sequence number in the message will be stored in a custom context, and the custom context is implemented using the JAVA native ThreadLocal class. ThreadLocal is a storage class within a thread that can store data within a specified thread. After the data is stored, only the specified thread can obtain the stored data. ThreadLocal uses a separate storage space for each thread, which has the effect of thread isolation. The corresponding value can only be obtained within the thread, and the desired value cannot be accessed outside the thread. Therefore, the current thread conducting the transaction can obtain the sub-transaction sequence number transmitted from the upstream system to this system through the custom context.

[0106] A stack data structure is created in the custom context. This structure is used to store newly generated sub-transaction numbers, which are recorded as sub-transaction number stacks. The number of sub-transaction numbers stored in the stack is 0 at the beginning. Each time a new sub-transaction number is generated, the sub-transaction number is pushed into the stack. The top element of the stack is always the latest sub-transaction number. It should be noted that there are two attributes in the custom context to store sub-transaction numbers, which are recorded as subTxNo and subTxNoStack in this application. The difference between the two attributes is shown in Table 3 below.

[0107] Table 3

[0108]

[0109] When the sub-transaction number needs to be upgraded, it is mainly judged by whether the number of elements in the sub-transaction number stack subTxNoStack is 0. If it is 0, it means that the current system has not generated a sub-transaction number, indicating that the current system is calling the external system for the first time, and the logic of upgrading is performed. When upgrading, it is necessary to take out the sub-transaction number subTxNo transmitted from the upstream system to this system from the custom context, and use it as a reference to complete the logic of upgrading the sub-transaction number in the above section, and finally push the newly generated sub-transaction number into the sub-transaction number stack subTxNoStack of the custom context.

[0110] When the sub-transaction sequence number is upgraded, it is also judged by whether the number of elements in the sub-transaction sequence number stack subTxNoStack is 0. If it is not 0, it means that the current system has generated a sub-transaction sequence number, which means that the current system is not calling the external system for the first time, and the upgrade logic is performed. When upgrading, it is necessary to obtain the sub-transaction sequence number at the top of the stack from the sub-transaction sequence number stack subTxNoStack, and use the sub-transaction sequence number as the basis to complete the logic of upgrading the sub-transaction sequence number in the above section, and finally push the newly generated sub-transaction sequence number into the sub-transaction sequence number stack subTxNoStack.

[0111] When the calling system needs to generate a sub-transaction sequence number, the top element of the sub-transaction sequence number stack of the custom context is returned to the system.

[0112] In another embodiment of the present application, the generation unit includes a fourth acquisition subunit, a first generation subunit, a third determination subunit, a fourth determination subunit, a fifth determination subunit, a second generation subunit, a fifth acquisition subunit and a sixth determination subunit, wherein the fourth acquisition subunit is used to acquire an identification code corresponding to the current call initiator system, and determine the identification code as a prefix of the target sub-transaction sequence number; the first generation subunit is used to generate the target sub-transaction sequence number to obtain the transaction instance sequence number; the third determination subunit is used to determine the level of the current system in the transaction link, and determine the level number corresponding to the level; the fourth determination subunit is used to determine the level of the current system in the transaction link, and determine the level number corresponding to the level; The unit is used to determine the number of the current level of the current system in the transaction link; the fifth determination subunit is used to determine the number of characters contained in the target sub-transaction sequence number; the second generation subunit is used to arrange the prefix and the level number in sequence, and determine that the characters other than the prefix and the level number are 0, so as to generate the reference sequence number corresponding to the target sub-transaction sequence number; the fifth acquisition subunit is used to obtain the calling situation of the current calling initiator system calling the current called system, and adjust the reference sequence number according to the calling situation; the sixth determination subunit is used to determine the adjusted reference sequence number as the target sub-transaction sequence number. In this embodiment, the prefix of the calling initiator system and the level number of the exchange are first determined, and then the number of characters in the target sub-transaction sequence number is determined, the prefix and the level number are arranged in sequence, and the characters other than the prefix and the level number are determined to be 0, so as to generate the target sub-transaction sequence number, so that the calling initiator system can be quickly located by the prefix from the generated target sub-transaction sequence number, and the number of times the call has been made can be located according to the level number, so as to more quickly locate the system where the abnormality occurs.

[0113] The specific process of generating the target sub-transaction number is as follows: Figure 7 Taking the transaction link shown as an example, this link focuses on the generation process of the latest transaction arrangement number. The system number and transaction instance number in the sub-transaction sequence number are uniformly represented by corresponding placeholders. For example, system A uses the letter "A" to represent its system number and transaction instance number, system B uses the letter "B" to represent its system number and transaction instance number, and so on.

[0114] (1) System A, as the transaction initiator, generates the first sub-transaction number of this transaction, which is "A10000000000000000000". System A, as the transaction initiator, has a transaction level number of 1, so the first digit of its corresponding latest transaction number is 1, and the last 19 digits are all 0;

[0115] (2) System A first calls system B, then calls system C, and then calls system D.

[0116] At this time, three new sub-transaction numbers need to be generated to represent these three call branches. The system number and transaction instance number in the three sub-transaction numbers are all generated by system A, so the prefix of the sub-transaction numbers is A. The first time, system A calls system B, which is the first time that system A calls an external system, so the logic of upgrading is required. Taking the first sub-transaction number "A1000000000000000000" as the benchmark, according to the above logic of upgrading, the sub-transaction number obtained is "A11000000000000000000"; the second time, system A calls system C, which is not the first time that system A calls an external system, so the logic of upgrading is required, and the previous sub-transaction number "A1100000000000000000" is used as the benchmark. 000000000000000" is taken as the benchmark, according to the upgrading logic, the obtained sub-transaction number is "A12000000000000000000"; the third time, system A calls D, which is not the first time that system A calls an external system, so it is necessary to perform upgrading logic, taking the previous sub-transaction number "A12000000000000000000" as the benchmark, according to the upgrading logic, the obtained sub-transaction number is "A13000000000000000000".

[0117] (3) System B calls System E, and System B calls System F. At this time, two new sub-transaction numbers need to be generated to represent the two calling sub-branches. The system number and transaction instance number in the two sub-transaction numbers are both generated by System B. The first time, System B calls System E, which is System B's first call to an external system, so it is necessary to perform the logic of upgrading. The previous sub-transaction number "A11000000000000000000" is used as the basis. According to the logic of upgrading, the sub-transaction number generated is "B11100000000000000000"; the second time, System B calls System F, which is not System B's first call to an external system, so it is necessary to perform the logic of upgrading. The previous sub-transaction number "B111000000000000000000 is used as the basis. According to the logic of upgrading, the sub-transaction number obtained is "B11200000000000000000".

[0118] (4) System D calls system G. At this time, a new sub-transaction number needs to be generated to represent this calling sub-branch. The system number and transaction instance number of this sub-transaction number are generated by system D. System D calls system G, which is the first time that system D calls an external system. Therefore, the logic of upgrading is required. Based on the previous sub-transaction number "A13000000000000000000", according to the logic of upgrading, the sub-transaction number obtained is "D13100000000000000000". At this point, the latest transaction arrangement number generation process of this transaction link has been completed.

[0119] Taking the target sub-transaction number "D13100000000000000000" generated above as an example, we can first know that the system caller is system D; in the last 20 digits of the latest transaction arrangement number, there are 3 non-0 characters, which indicates that the transaction level number of the current system in the transaction chain is 3; find the position where the character 0 first appears from left to right in the latest transaction arrangement number, recorded as pos, and the character corresponding to the position where pos minus one is "1", indicating that the current system is the first system called by system D.

[0120] In order to locate the abnormal system more quickly, in another embodiment of the present application, the fifth acquisition subunit includes a judgment module, a first adjustment module and a second adjustment module, wherein the judgment module is used to judge whether the current calling initiator system is calling the external system for the first time when calling the current called system; the first adjustment module is used to upgrade the reference sequence number so that the first character of the reference sequence number that is 0 is converted to 1 when the current calling initiator system is calling the external system for the first time; the second adjustment module is used to upgrade the reference sequence number so that the level number in the reference sequence number is adjusted by 1 when the current calling initiator system is not calling the external system for the first time. In this embodiment, the upgrade logic or the upgrade logic is performed according to whether the calling initiator system is calling the external system for the first time, so that the calling status of the current system can be obtained according to the first bit and the level number in the reference sequence number.

[0121] In a specific embodiment of the present application, the above-mentioned upgrade logic is as follows: Figure 8 As shown, it is necessary to find the first position where the character 0 appears from left to right in the latest transaction arrangement number. If the position exists, change the character 0 to 1 to complete the upgrade logic of the latest transaction arrangement number. If the position does not exist, it means that the transaction level number has reached the maximum and cannot be upgraded further.

[0122] In another specific embodiment of the present application, the above-mentioned upgrading logic is as follows Fig. 9As shown, first find the first position of character 0 from left to right in the latest transaction arrangement number, recorded as pos. If pos exists, get the character at position pos minus 1, and then determine whether the character is Z. Count and perform base operation. If it is Z, it means that the number of transaction instances at the same level has reached the maximum. If it is not Z, the character is incremented. It should be noted that when the character is 9, the result after increment is A. If pos does not exist, get the last character in the latest transaction arrangement number, and then determine whether the character is Z. The subsequent steps are the same as the previous steps.

[0123] The device for locating abnormal transactions includes a processor and a memory. The acquisition unit and the positioning unit are stored in the memory as program units. The processor executes the program units stored in the memory to implement corresponding functions.

[0124] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the problem of the transaction serial number in the related technology being difficult to locate the system where the abnormality occurs when the transaction is abnormal is solved by adjusting the kernel parameters.

[0125] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0126] An embodiment of the present invention provides a non-volatile storage medium on which a program is stored. When the program is executed by a processor, the method for locating abnormal transactions is implemented.

[0127] An embodiment of the present invention provides a processor, and the processor is used to run a program, wherein the method for locating abnormal transactions is executed when the program is run.

[0128] An embodiment of the present invention provides a device, the device including a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, the following steps are implemented:

[0129] Step S101, when an abnormal transaction is detected among multiple transactions, obtaining a target serial number corresponding to the abnormal transaction;

[0130] Step S102, locate the abnormal transaction according to the target serial number to determine the information of the abnormal transaction and the corresponding calling system when the abnormal transaction occurs in the transaction link, wherein the calling system includes the calling initiator system of the transaction.

[0131] The devices in this article can be servers, PCs, PADs, mobile phones, etc.

[0132] The present invention also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing the following method steps:

[0133] Step S101, when an abnormal transaction is detected among multiple transactions, obtaining a target serial number corresponding to the abnormal transaction;

[0134] Step S102, locate the abnormal transaction according to the target serial number to determine the information of the abnormal transaction and the corresponding calling system when the abnormal transaction occurs in the transaction link, wherein the calling system includes the calling initiator system of the transaction.

[0135] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable non-volatile storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0136] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0137] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0138] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0139] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0140] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0141] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of non-volatile storage media for computers include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0142] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0143] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable non-volatile storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0144] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:

[0145] 1) In the method for locating abnormal transactions of the present application, first, when abnormal transactions are detected in multiple transactions, the target serial number corresponding to the abnormal transaction is obtained, and then the abnormal transaction is located according to the target serial number, and the information of the abnormal transaction and the corresponding calling system when the abnormality occurs are determined, and the calling system includes the initiator system of the transaction call and the called system. In this method, the target serial number of the abnormal transaction obtained is unique, and a transaction can be uniquely located, and each system called by the transaction link can be described. Therefore, the information of the abnormal transaction and the calling system when the abnormality occurs can be located according to the target serial number, so that the system where the abnormality occurs can be located according to the target serial number, thereby solving the technical problem in the related art that it is difficult to locate the system where the abnormality occurs when the transaction serial number is abnormal.

[0146] 2) The device for locating abnormal transactions of the present application includes an acquisition unit and a positioning unit. The acquisition unit is used to acquire the target serial number corresponding to the abnormal transaction when an abnormal transaction is detected in multiple transactions. The positioning unit is used to locate the abnormal transaction according to the target serial number, determine the information of the abnormal transaction and the corresponding calling system when the abnormality occurs, and the calling system includes the initiator system and the called system of the transaction call. In the device, the target serial number of the abnormal transaction obtained is unique, and a transaction can be uniquely located, and each system called by the transaction link can be described. Therefore, the information of the abnormal transaction and the calling system when the abnormality occurs can be located according to the target serial number, so that the system where the abnormality occurs can be located according to the target serial number, thereby solving the technical problem in the related art that it is difficult to locate the system where the abnormality occurs when the transaction serial number is abnormal.

[0147] The above are only embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.

Claims

1. A method for locating abnormal transactions, characterized in that: include: When an abnormal transaction is detected among multiple transactions, obtaining a target serial number corresponding to the abnormal transaction; The abnormal transaction is located according to the target serial number to determine the information of the abnormal transaction and the corresponding calling system when the abnormal transaction occurs abnormally in the transaction link, wherein the calling system includes the calling initiator system of the transaction, When an abnormal transaction is detected among multiple transactions, obtaining a target serial number corresponding to the abnormal transaction includes: When an abnormal transaction is detected among multiple transactions, obtaining a current message generated by the abnormal transaction during the transaction process; The target serial number contained in the message is obtained, wherein the target serial number includes a global business tracking number corresponding to the abnormal transaction and a sub-transaction sequence number corresponding to the abnormal transaction, and the global business tracking number runs through the entire transaction process corresponding to the abnormal transaction. Locating the abnormal transaction according to the target serial number to determine information about the abnormal transaction includes: Parse the global business tracking number and obtain a first parsing result, wherein the first parsing result at least includes a timestamp, a first system number, a first transaction instance number and a sequence number, the timestamp being the timestamp corresponding to the abnormal transaction when the transaction is initiated, the first system number being an identification code corresponding to the original initiator system of the abnormal transaction, the first transaction instance number being an identification code of a machine where the transaction instance corresponding to the abnormal transaction is located, and the sequence number being a cyclically increasing sequence number generated by the original initiator system when the abnormal transaction is initiated; Determine the information of the abnormal transaction according to the first analysis result, The abnormal transaction is located according to the target serial number to determine the corresponding calling system when the abnormal transaction occurs abnormally in the transaction link, including: Obtaining a target sub-transaction sequence number contained in the target serial number, wherein the target sub-transaction sequence number is a current sub-transaction sequence number generated during the transaction process of the abnormal transaction; Parse the target sub-transaction serial number and obtain a second parsing result, wherein the second parsing result at least includes a second system number, a second transaction instance serial number and a latest transaction arrangement number, wherein the second system number is an identification code corresponding to the current call initiator system corresponding to the abnormal transaction, the second transaction instance serial number is an identification code of a machine where the transaction instance corresponding to the current call initiator system is located, and the latest transaction arrangement number represents a call link to the system in the current call process from both horizontal and vertical dimensions; According to the second analysis result, a corresponding calling system is determined when an abnormality occurs in the transaction link of the abnormal transaction.

2. The method according to claim 1, characterized in that Before locating the abnormal transaction according to the target serial number to determine the information of the abnormal transaction, the method further includes: Obtain the MAC address corresponding to the machine where the original transaction instance corresponding to the abnormal transaction is located; Calculate a hash value corresponding to the MAC address, and perform a modulo operation on the hash value to obtain a modulo result; A zero padding operation is performed on the modulo result to obtain the first transaction instance serial number.

3. The method according to claim 1, characterized in that Before locating the abnormal transaction according to the target serial number to determine the corresponding calling system when the abnormal transaction occurs abnormally in the transaction link, the method includes: Acquire current system call information corresponding to the abnormal transaction in the transaction link, wherein the current system call information at least includes information of the current call initiator system and information of the current called system corresponding to the abnormal transaction; The target sub-transaction sequence number is generated according to the current system call information.

4. The method according to claim 3, characterized in that Generate the target sub-transaction sequence number according to the current system call information, including: Obtaining an identification code corresponding to the current call initiator system, and determining the identification code as a prefix of the target sub-transaction sequence number; Determine the level of the transaction link in which the current system is located, and determine the number corresponding to the level of the transaction link; Arrange the prefix and the number in sequence, and determine that the characters other than the prefix and the level number are 0, so as to generate a reference number corresponding to the target sub-transaction number; Acquire the calling status of the current calling initiator system calling the current called system, and adjust the reference sequence number according to the calling status; The adjusted reference serial number is determined as the target sub-transaction serial number.

5. The method according to claim 4, characterized in that Acquiring a call status of the current calling initiator system calling the current called system, and adjusting the reference sequence number according to the call status, including: Determine whether the current calling initiator system is calling an external system for the first time when calling the current called system; In the case that the current call initiator system calls the external system for the first time, performing layer-up processing on the reference sequence number so that the first character of the reference sequence number that is 0 is converted to 1; In the case that the current call initiator system is not calling the external system for the first time, the reference sequence number is upgraded to adjust the level number in the reference sequence number by adding 1.

6. A device for locating abnormal transactions, characterized in that: include: A first acquisition unit is used to acquire a target serial number corresponding to an abnormal transaction when an abnormal transaction is detected among multiple transactions; A positioning unit is used to locate the abnormal transaction according to the target serial number to determine the information of the abnormal transaction and the corresponding calling system when the abnormal transaction occurs abnormally in the transaction link, wherein the calling system includes the calling initiator system of the transaction, and the first obtaining unit includes: A first acquisition subunit is used to acquire a current message generated by the abnormal transaction during the transaction process when an abnormal transaction is detected among multiple transactions; The second acquisition subunit is configured to acquire the target serial number contained in the message, wherein the target serial number includes a global business tracking number corresponding to the abnormal transaction and a sub-transaction sequence number corresponding to the abnormal transaction, and the global business tracking number runs through the entire transaction process corresponding to the abnormal transaction. The positioning unit comprises: A first parsing subunit is used to parse the global business tracking number and obtain a first parsing result, wherein the first parsing result at least includes a timestamp, a first system number, a first transaction instance number and a sequence number, the timestamp is a timestamp corresponding to the abnormal transaction when the transaction is initiated, the first system number is an identification code corresponding to the original initiator system of the abnormal transaction, the first transaction instance number is an identification code of a machine where the transaction instance corresponding to the abnormal transaction is located, and the sequence number is a cyclically increasing sequence number generated by the original initiator system when the abnormal transaction is initiated; a first determining subunit, configured to determine information of the abnormal transaction according to the first parsing result; The positioning unit further includes: A third acquisition subunit is used to acquire a target sub-transaction sequence number contained in the target serial number, wherein the target sub-transaction sequence number is a current sub-transaction sequence number generated during the transaction process of the abnormal transaction; A second parsing subunit is used to parse the target sub-transaction serial number and obtain a second parsing result, wherein the second parsing result at least includes a second system number, a second transaction instance serial number and a latest transaction arrangement number, wherein the second system number is an identification code corresponding to the current call initiator system corresponding to the abnormal transaction, the second transaction instance serial number is an identification code of a machine where the transaction instance corresponding to the current call initiator system is located, and the latest transaction arrangement number represents a call link to the system in the current call process from two dimensions, horizontally and vertically; The second determining subunit is used to determine, according to the second parsing result, a corresponding calling system when an abnormality occurs in the transaction link of the abnormal transaction.

7. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute a method for locating abnormal transactions as described in any one of claims 1 to 5.

8. A processor, characterized in that: The processor is used to run a program, wherein the program, when running, executes a method for locating abnormal transactions as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Abnormal transaction detection method and device, electronic device and storage medium

    CN109767329A

  • Transaction link exception handling method and related device

    CN110223173A