A method, apparatus, device, and storage medium for processing reverse transactions.
By utilizing positive transaction flow information for rapid matching and correlation in the reversal transaction processing, the problems of large data volume and long processing time in existing technologies are solved, achieving efficient transaction processing and business logic support.
Patent Information
- Application Number
- CN202110552340.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-20
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2041-05-20
AI Technical Summary
Existing reversal transaction processing methods require complete transaction information, resulting in large data volumes, long processing times, and the risk of information inconsistency, making them unable to flexibly support complex business logic.
When a reversal transaction request is received, it is determined whether there is matching positive transaction information. The reversal transaction request is responded to based on the positive transaction information. The reversal transaction information is recorded and associated. The key-value database and VARCHAR field information of the data table are used for fast matching and storage, which reduces the amount of transaction data and simplifies the transaction processing flow.
It reduces the amount of pending transaction data, shortens the processing time for reversal transactions, avoids inconsistencies in internal transaction information, and supports the processing of complex business logic.
Smart Images

Figure CN113159960B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of automatic programming, and more particularly to a method, apparatus, device and storage medium for processing reverse transactions. Background Technology
[0002] With the continuous advancement of computer technology, financial services are becoming increasingly diversified, and their reliance on online transactions is deepening. Therefore, the processing of online transactions has become particularly important.
[0003] After an online transaction occurs, due to certain technical or business reasons, it may be necessary to reverse the original transaction, that is, to reverse the original transaction. When processing reversed and positive transactions, it is usually broken down into multiple transactions. For example, the channel access transaction part records the transaction status when the caller accesses the channel; the external call transaction part records the transaction status of the external components when making an external call; and the local logic transaction part records the transaction part of local logic processing. The specific reversal is then performed through the above multiple transaction information.
[0004] However, this method of reversing transactions requires that the reversal transaction request include complete transaction information, and the amount of data to be processed is extremely large. The reversal time is long, and there is also a risk of inconsistency between the transaction information of different parts. It is not flexible enough to support complex business logic. Summary of the Invention
[0005] This invention provides a method, apparatus, device, and storage medium for processing reversal transactions, in order to respond to reversal transaction requests based on positive transaction flow information.
[0006] In a first aspect, embodiments of the present invention provide a method for processing reversal transactions, including:
[0007] When a reversal transaction request is received, it is determined whether there is positive transaction flow information that matches the reversal transaction request;
[0008] If it is determined that there is positive transaction flow information that matches the reversal transaction request, then the reversal transaction request is responded to based on the positive transaction flow information;
[0009] Record the reverse transaction flow information and associate it with the positive transaction flow information.
[0010] Secondly, embodiments of the present invention provide a processing apparatus for reversal transactions, comprising:
[0011] The positive transaction flow information judgment module is used to determine whether there is positive transaction flow information that matches the reverse transaction request when a reverse transaction request is obtained;
[0012] The reverse transaction request response module is used to respond to the reverse transaction request based on the positive transaction flow information if it is determined that there is positive transaction flow information that matches the reverse transaction request.
[0013] The associated execution module is used to record the reverse transaction flow information and associate it with the positive transaction flow information.
[0014] Thirdly, embodiments of the present invention also provide an electronic device, the electronic device comprising:
[0015] One or more processors;
[0016] Storage device for storing one or more programs;
[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement the reversal transaction processing method described in any embodiment of the present invention.
[0018] Fourthly, embodiments of the present invention also provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, implement the reversal transaction processing method described in any embodiment of the present invention.
[0019] The technical solution provided by this invention, when a reversal transaction request is received, responds to the reversal transaction request based on the positive transaction flow information matching the reversal transaction request, and records the reversal transaction flow information and the correlation between the reversal transaction flow information and the positive transaction flow information. This means that the reversal transaction request does not need to include complete transaction information, reducing the amount of transaction data to be processed, shortening the processing time of the reversal transaction, and avoiding the occurrence of inconsistencies in multiple internal transaction information. At the same time, executing the reversal transaction based on the stored positive transaction flow information also provides sufficient data support for complex business processing logic. Attached Figure Description
[0020] Figure 1 This is a flowchart of a reversal transaction processing method provided in Embodiment 1 of the present invention;
[0021] Figure 2 This is a flowchart of a reversal transaction processing method provided in Embodiment 2 of the present invention;
[0022] Figure 3 This is a flowchart of a reversal transaction processing method provided in Embodiment 3 of the present invention;
[0023] Figure 4 This is a structural block diagram of a reversal transaction processing device provided in Embodiment 4 of the present invention;
[0024] Figure 5This is a structural block diagram of an electronic device provided in Embodiment 5 of the present invention. Detailed Implementation
[0025] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention and not the entire structure.
[0026] Example 1
[0027] Figure 1 This is a flowchart of a method for processing reversal transactions according to Embodiment 1 of the present invention. This embodiment is applicable to processing reversal transactions based on positive transaction flow information. This method can be executed by the reversal transaction processing device in this embodiment of the present invention. This device can be implemented by software and / or hardware and can be integrated into a terminal device or server. Typically, it can be integrated into the server of a distributed and microservice-based banking business system. The method specifically includes the following steps:
[0028] S110. When a reversal transaction request is obtained, determine whether there is positive transaction flow information that matches the reversal transaction request.
[0029] A positive transaction represents a positive transaction logic, a type of transaction carried out to achieve a certain business effect; for example, if account A transfers 100 yuan to account B, then 100 yuan is deducted from account A and 100 yuan is added to account B, which is a positive transaction. A reverse transaction is the reverse of a positive transaction, and its purpose is to remove the positive transaction. Taking the above positive transaction as an example, returning the deducted 100 yuan to account A and deducting the added 100 yuan from account B is a reverse transaction.
[0030] A reversal request can include a request initiated by the transaction initiator to cancel a positive transaction after it has been completed. For example, Account A, after executing a transfer transaction and receiving feedback from the banking system confirming the successful transfer, requests to cancel the transaction. It can also include a reversal request initiated by the transaction initiator's terminal device when it detects an anomaly in the positive transaction. For example, the positive transaction has been marked as successful on the terminal device, but the transaction package sent to the banking system has not received a response (i.e., the transaction timed out). Without certainty that the transaction was successfully completed on the banking system, the terminal device, to ensure the user's interests, resends a request to the banking system to cancel the transaction.
[0031] Transaction information is recorded in the business system's database and includes business information involved in the transaction process, such as the transaction parties (i.e., the transaction initiator and the transaction responder) and the transaction type (e.g., deposit, withdrawal, income, expenditure). When the bank's business system processes a positive transaction request, it records the transaction information for that positive transaction. Therefore, if the positive transaction information is retrieved from the database, it also indicates that the positive transaction has been completed.
[0032] Optionally, in this embodiment of the invention, the positive transaction log information includes key-value information; the key-value information includes a legal entity identifier, a global event tracking number, a sub-transaction sequence number, and a transaction direction identifier. When the bank's business system completes the processing of a positive transaction and registers the positive transaction log information, it stores the key-value information in the positive transaction log information in a key-value database. Utilizing the fast access speed and high query efficiency of the key-value database, it achieves rapid matching between reversal and positive transactions. Compared to querying data from a relational database, this improves the efficiency of obtaining relevant data for positive transactions and increases the matching speed between reversal and positive transactions.
[0033] The legal entity identification document (Identity document) is used to identify a specific organization and distinguish business processes, user interfaces, and data. The Legal Entity ID is reflected in system data flow and data storage and can be represented by a 5-digit code consisting of two segments (country or region code + legal entity code), serving as the legal entity identification information during the transaction process. The Global Event Tracking Number (GAN) is a globally unique identifier generated when a transaction is triggered. This identifier is shared throughout the entire transaction process as the transaction identity, thus connecting the entire transaction line from the transaction initiator to the transaction service processing end. The number of digits in the GNA can be set as needed, for example, it can be set to 25 digits. The Sub-Transaction Sequence Number is used to distinguish the internal number of each transaction node. The number of digits in the Sub-Transaction Sequence Number can also be set as needed, for example, it can be set to 10 digits. For combined transactions, the sub-transaction sequence number is modified by the combination points between each transaction; for non-combined transactions, the sub-transaction sequence number is all 0. The global event tracking number can uniquely locate a transaction, and within that transaction, the specific transaction node can be determined by the sub-transaction sequence number. The transaction direction identifier indicates whether the transaction is a positive or negative transaction; if it is a positive transaction, the transaction direction identifier is 0, and if it is a negative transaction, the transaction direction identifier is 1. Key-value information can also include a logical partition number, represented in the form of "license plate number + reverse identifier". The license plate number is related to the business date of the transaction, and the reverse identifier is the reverse of a specified number of digits of the global event tracking number. For example, the logical partition number is represented by a 2-digit license plate number plus the last 3 digits of the global event tracking number in reverse order.
[0034] Specifically, determining whether there is positive transaction flow information matching the reversal transaction request includes: parsing the reversal transaction request to obtain the transaction identifier of the positive transaction matching the reversal transaction request; wherein, the transaction identifier includes a global event tracking number and a sub-transaction sequence number; and determining whether there is positive transaction flow information matching the reversal transaction request based on the transaction identifier of the positive transaction. Parsing the reversal transaction request only requires obtaining the global event tracking number and sub-transaction sequence number of the corresponding positive transaction, and the existence of positive transaction flow information matching the reversal transaction request can be determined based on the above information.
[0035] Optionally, in this embodiment of the invention, the positive transaction log information further includes VARCHAR field information in a data table; the VARCHAR field information in the data table includes a data length bit, a region flag bit, a request message area, a response message area, and / or an application scenario area; the data length bit is used to record the length of the VARCHAR field information in the data table; the region flag bit is used to record whether the requested message area, the response message area, and the application scenario area exist; the request message area is used to record the request message header and the request message body; the response message area is used to record the response message header and the response message body; and the application scenario area is used to record the calling logic of the application component. VARCHAR is a flexible data type used to store character data. Compared to traditional CHAR character data, VARCHAR can store variable-length strings and occupies less storage space. The VARCHAR field information in a data table is the data content stored in the data table of a relational database. The request message area, response message area, and application scenario area all store data in JSON string format, and the areas are separated by "#@@#". Specifically, the request message area and response message area store all message information for the transaction, including the global event tracking number and sub-transaction sequence number. Therefore, based on the global event tracking number and sub-transaction sequence number of the matching positive transaction, the matching VARCHAR field information of the data table can be obtained from the relational database.
[0036] Optionally, in this embodiment of the invention, the key-value information further includes a sequence number; the sequence number is related to the length of the VARCHAR field information in the data table. The VARCHAR data type has a maximum allowed string length (e.g., set to 12KB). If the amount of data in the VARCHAR field information of the data table is too large, exceeding the maximum length, it needs to be split into multiple data entries. The number of these split entries can be represented by a sequence number in the key-value information to reflect the association between the key-value information and the VARCHAR field information in the data table.
[0037] S120. If it is determined that there is positive transaction flow information that matches the reversal transaction request, then respond to the reversal transaction request according to the positive transaction flow information.
[0038] If a positive transaction log information matching the reversal transaction request exists, the processing logic can be reversed based on the processing logic of the positive transaction recorded in the database to respond to the reversal transaction. Alternatively, the calling logic of each application component (i.e., a functional module with transaction processing capability) involved in the transaction can be reversed through the application scenario area recorded in the data table in the above technical solution to process the reversal transaction. For example, during a positive transaction, application component A calls application component B, application component C, and application component D in sequence. Then, during a reversal transaction, application component A needs to call application component D, application component C, and application component B in sequence.
[0039] If the reversal transaction request includes a complete request message, the specific message object can be directly obtained by parsing the reversal transaction request. However, to facilitate initiating reversal transactions, especially when external systems (e.g., transaction business systems of other financial institutions) initiate reversal transaction requests to the current transaction business system, the external system may not store the specific transaction business data in the request message. Therefore, the request message of the external system may not contain a message entity field, but only the global event tracking number and sub-transaction sequence number of the matching positive transaction. Therefore, the request message object of the reversal transaction can be obtained by reading the request message of the positive transaction stored in the database. Specifically, responding to the reversal transaction request based on the positive transaction flow information includes: generating the reversal transaction request message based on the request message of the positive transaction matching the reversal transaction request; and responding to the reversal transaction request based on the reversal transaction request message. When a request message for a positive transaction is received, the Java object is converted into a JSON string for storage. When the stored information is read, the JSON string is converted back into a Java object. This avoids the tedious mapping and parsing of XML request messages, improving the storage and retrieval efficiency of transaction messages.
[0040] Optionally, in this embodiment of the invention, the application scenario area records the calling logic of application components through a runtime stack. The runtime stack is the stack relationship of the current application component calls, mainly recording the nesting level of the current application component; for example, when application component A calls application component B, application component B is pushed onto the stack, and the stack relationship of the application components called in this transaction is A+B; when application component B completes its call and returns to application component A, the stack relationship is A; to ensure the uniqueness of the stack relationship of application component calls, when an application calls the same application component multiple times at the same nesting level, the sequence number of the application component being called must be specified; taking the calling logic of application components in a transaction recorded in Table 1 as an example...
[0041] Table 1
[0042]
[0043]
[0044] The transaction entry point is application component A. Application component A first calls (CALL) application component B. Within application component B, the transaction sequentially calls application components C, D, and C. Specifically, when the transaction enters application component A, the nesting level is 1, and the stack relationship is A(01). When application component A calls application component B, the transaction enters application component B, and the nesting level is 2, with a stack relationship of A(01)+B(01). When application component B calls application component C for the first time, the transaction enters C, and the nesting level is 3, with a stack relationship of A(01)+B(01)+C(01). When application component C returns (GOBACK), the transaction returns to application component B, and the nesting level is 2, with a stack relationship of A(01)+B(01). When application component B calls... Using application component D, after the transaction enters D, the nesting level is 3, and the stack relationship is A(01)+B(01)+D(01). When application component D returns, the transaction returns to application component B, and the nesting level is 2. The stack relationship of the module call is A(01)+B(01). When application component B calls application component C for the second time, after the transaction enters application component C, the nesting level is 3, and the stack relationship is A(01)+B(01)+C(02). The stack relationship at this time is different from that of application component B's first call to application component C (the numbers 01 and 02 in parentheses represent the first and second calls, respectively). When application component C returns, the transaction returns to application component B, and the nesting level is 2. When application component B returns, the transaction returns to application component A, and the nesting level is 1.
[0045] In particular, in this embodiment of the invention, the execution logic of the application component can be directly implemented by executing code. Compared with implementation through configuration, configuration can only realize simple call flow and simple interface transmission. However, in microservice-based business systems, the call relationship for handling transactions is more complex, and most of the interface fields during the call come from calculation and database access. Implementation directly through executing code can better meet the complex call logic.
[0046] S130. Record the reverse transaction flow information and associate it with the positive transaction flow information.
[0047] When processing a reversal transaction request, the transaction flow information is recorded in a database. The reversal transaction flow information and the corresponding positive transaction flow information can be associated with specific identifiers. For example, in each database, the same association identifier is set for the reversal transaction and its corresponding positive transaction to mark the association relationship between the reversal transaction and the positive transaction. Furthermore, the global event tracking number of the previous transaction of the reversal transaction can be set as the global event tracking number of the matching positive transaction, and the sub-transaction sequence number of the previous transaction of the reversal transaction can be set as the sub-transaction sequence number of the positive transaction. Similarly, the global event tracking number of the next transaction of the positive transaction can be set as the global event tracking number of the reversal transaction, and the sub-transaction sequence number of the next transaction of the positive transaction can be set as the sub-transaction sequence number of the reversal transaction. The global event tracking number and sub-transaction sequence number of the reversal transaction are generated during the processing of the reversal transaction, following the same process as generating the global event tracking number and sub-transaction sequence number of the positive transaction during the processing of the positive transaction.
[0048] The technical solution provided by this invention, when a reversal transaction request is obtained, responds to the reversal transaction request based on the positive transaction flow information matching the reversal transaction request, and records the reversal transaction flow information and the correlation between the reversal transaction flow information and the positive transaction flow information. This means that the reversal transaction request does not need to include complete transaction information, reducing the amount of transaction data to be processed, shortening the processing time of the reversal transaction, and avoiding the occurrence of inconsistencies in multiple internal transaction information. At the same time, executing the reversal transaction based on the stored positive transaction flow information also provides sufficient data support for complex business processing logic.
[0049] Example 2
[0050] Figure 2This is a flowchart of a method for processing a reversal transaction according to Embodiment 2 of the present invention. This embodiment is a specific implementation based on the above technical solution. In this embodiment, the positive transaction flow information includes fixed field information of a data table. Before responding to the reversal transaction request based on the positive transaction flow information, the method further includes: comparing the request message of the reversal transaction with the fixed field information of the matching positive transaction data table. Specifically, the method includes the following steps:
[0051] S210. When a reversal transaction request is obtained, determine whether there is positive transaction flow information that matches the reversal transaction request; wherein, the positive transaction flow information includes fixed column information of the data table.
[0052] The fixed fields in the data table include identification information, institutional information, and account identity information; the identification information includes transaction code, service type, system time, global event tracking number, and / or sub-sequence transaction number; and / or the institutional information includes transaction institution, transaction teller, transaction channel, and / or business date; and / or the account identity information includes transaction master account, transaction counterparty account, free trade zone attribute of transaction master account, and / or free trade zone attribute of transaction counterparty account. Fixed field information in a data table refers to the data content stored in fixed fields within a relational database table. Among these, "Service Type" is a coded information describing the transaction type, including a transaction field indicating whether the transaction is a positive or negative transaction. For example, a service type identifier is a 6-digit number, with the fourth digit being the transaction field; a fourth digit of 0 indicates a positive transaction, and a fourth digit of 1 indicates a negative transaction. The transaction code also serves as a unique identifier for each transaction in the database. "Transaction Channel" refers to the specific method of implementing the transaction, such as over-the-counter, online banking, or ATM. "Transaction Institution" refers to the region and branch where the transaction occurred. "Transaction Teller" is the staff member handling the transaction. "Business Date" is the time the transaction occurred.
[0053] S220. If it is determined that there is positive transaction flow information that matches the reversal transaction request, the request message of the reversal transaction is compared with the fixed column information of the data table of the matching positive transaction.
[0054] S230. If the request message for the reverse transaction is consistent with the fixed field information of the data table of the positive transaction, then respond to the reverse transaction request according to the request message for the reverse transaction.
[0055] Since the reversal transaction request message is obtained by directly parsing the reversal transaction request or by parsing the request message from the VARCHAR field information of the positive transaction data table, to ensure the accuracy of the obtained reversal transaction request message, a consistency comparison is performed between the reversal transaction request message and the fixed field information of the positive transaction data table. For example, the transaction code, trading institution, and trading teller in the reversal transaction request message are compared with the same items in the fixed field information of the positive transaction data table to determine if they are consistent; the business date of the reversal transaction is compared with the business date in the fixed field information of the positive transaction data table. If the dates are consistent, or if the reversal transaction... If the transaction date is one day earlier than the original transaction date, and the reversal transaction occurs within a preset time (e.g., two hours) after the original transaction date changes, then the request message for the original transaction is considered consistent with the fixed field information in the data table of the original transaction. This mechanism stipulates that the reversal transaction must be performed on the same day as the original transaction or completed within a certain period after the date change, so that when the previous day's transaction records are archived daily after the specified time, the previous day's transaction records are already in their final state and will not have their fields modified due to the reversal transaction. If the request message for the reversal transaction is inconsistent with the fixed field information in the data table of the original transaction, a transaction alarm message is issued to indicate that the reversal transaction is abnormal.
[0056] S240. Record the reverse transaction flow information and associate it with the positive transaction flow information.
[0057] The technical solution provided by this invention, when it is determined that there is positive transaction flow information that matches the reversal transaction request, compares the reversal transaction request message with the fixed field information of the data table of the matching positive transaction, and responds to the reversal transaction request when the match is consistent, thus ensuring the accuracy of the reversal transaction request message and improving the security of the reversal transaction.
[0058] Example 3
[0059] Figure 3 This is a flowchart of a method for processing a reversal transaction according to Embodiment 3 of the present invention. This embodiment is a specific implementation based on the above technical solution. In this embodiment, if it is determined that there is no positive transaction flow information matching the reversal transaction request, pseudo positive transaction flow information is inserted, and when a positive transaction request matching the reversal transaction request is obtained, the positive transaction request is not responded to. Specifically, the method includes the following steps:
[0060] S310. When a reversal transaction request is obtained, determine whether there is positive transaction flow information that matches the reversal transaction request.
[0061] S320. If it is determined that there is no positive transaction flow information matching the reversal transaction request, then insert pseudo positive transaction flow information and respond to the reversal transaction request according to the pseudo positive transaction flow information.
[0062] As described in the above technical solution, when an anomaly occurs in a positive transaction, such as a timeout, a reversal transaction request arrives before the positive transaction request. At this time, the positive transaction request is not processed, and the transaction log information for that positive transaction does not exist in the database. Inserting pseudo-positive transaction log information provides an execution basis for the reversal transaction, ensuring the smooth execution of the reversal transaction request. That is, the reversal transaction request is processed based on the pseudo-positive transaction log information, ensuring that the transaction caller (i.e., the transaction initiator) receives feedback information indicating a successful reversal. Furthermore, the pseudo-positive transaction log information is not real transaction information but rather transaction log information temporarily constructed based on the reversal transaction request, and will not affect other real transactions. The key-value information in the pseudo-positive transaction log can be directly constructed based on the key-value information of the positive transaction obtained from the reversal transaction request. That is, the key-value information in the pseudo-positive transaction log is the same as the key-value information in the real positive transaction log. However, the VARCHAR field information and fixed field information of the data table in the pseudo-positive transaction log are blank. It is equivalent to the reversal transaction and the pseudo-positive transaction being completely empty except for the key-value information that determines their mutual matching. The reversal transaction reverses a blank positive transaction and can return a reversal success feedback message to the transaction caller, but in fact, the reversal transaction is not actually completed.
[0063] S330. When a positive transaction request matching the reversal transaction request is obtained, the positive transaction request is marked as processed, and the positive transaction request is refused to be responded to.
[0064] Since the reversal transaction has been processed and a successful reversal feedback message has been returned to the transaction caller, but the reversal transaction has not actually been executed, when a matching positive transaction request is obtained, it is also not processed. Accordingly, neither the positive transaction request nor the reversal transaction request is processed, which is consistent with the result of processing both positive transaction requests and reversal transaction requests. It is not affected by the positive transaction timeout and does not affect the transaction processing efficiency of the system. At the same time, the transaction caller can obtain the successful reversal feedback message.
[0065] The technical solution provided by this invention inserts pseudo-positive transaction information when it is determined that no positive transaction information matches the reversal transaction request. Based on the pseudo-positive transaction information, the reversal transaction request is responded to. When a positive transaction request matching the reversal transaction request is obtained, the positive transaction request is refused to be responded to. This ensures that when a positive transaction times out, it does not affect the transaction processing efficiency of the system. The transaction caller can obtain feedback information that the reversal was successful. The transaction processing result in the system is also consistent with the result of processing both the positive transaction request and the reversal transaction request.
[0066] Example 4
[0067] Figure 4 This is a structural block diagram of a reversal transaction processing device provided in Embodiment 4 of the present invention. The device specifically includes:
[0068] The positive transaction flow information judgment module 410 is used to determine whether there is positive transaction flow information matching the reversal transaction request when a reversal transaction request is obtained;
[0069] The reverse transaction request response module 420 is used to respond to the reverse transaction request based on the positive transaction flow information if it is determined that there is positive transaction flow information that matches the reverse transaction request.
[0070] The associated execution module 430 is used to record the reverse transaction flow information and associate it with the positive transaction flow information.
[0071] The technical solution provided by this invention, when a reversal transaction request is obtained, responds to the reversal transaction request based on the positive transaction flow information matching the reversal transaction request, and records the reversal transaction flow information and the correlation between the reversal transaction flow information and the positive transaction flow information. This means that the reversal transaction request does not need to include complete transaction information, reducing the amount of transaction data to be processed, shortening the processing time of the reversal transaction, and avoiding the occurrence of inconsistencies in multiple internal transaction information. At the same time, executing the reversal transaction based on the stored positive transaction flow information also provides sufficient data support for complex business processing logic.
[0072] Optionally, based on the above technical solution, the positive transaction flow information includes key-value information; the key-value information includes legal entity identification, global event tracking number, sub-transaction sequence number, and transaction direction identifier.
[0073] Optionally, based on the above technical solution, the positive transaction flow information judgment module 410 specifically includes:
[0074] A transaction identifier acquisition unit is used to parse the reversal transaction request to obtain the transaction identifier of the positive transaction that matches the reversal transaction request; wherein, the transaction identifier includes a global event tracking number and a sub-transaction sequence number;
[0075] The positive transaction flow information determination unit is used to determine whether there is positive transaction flow information that matches the reversal transaction request based on the transaction identifier of the positive transaction.
[0076] Optionally, based on the above technical solution, the positive transaction log information further includes VARCHAR field information in a data table; the VARCHAR field information in the data table includes a data length bit, a region flag bit, a request message area, a response message area, and / or an application scenario area; the data length bit is used to record the length of the VARCHAR field information in the data table; the region flag bit is used to record whether the requested message area, the response message area, and the application scenario area exist; the request message area is used to record the request message header and the request message body; the response message area is used to record the response message header and the response message body; and the application scenario area is used to record the calling logic of the application components.
[0077] Optionally, based on the above technical solution, the key-value information also includes a sequence number; the sequence number is related to the length of the VARCHAR field information in the data table.
[0078] Optionally, based on the above technical solution, the reversal transaction request response module 420 specifically includes:
[0079] The request message generation unit is used to generate the request message for the reversal transaction based on the request message of the positive transaction that matches the reversal transaction request.
[0080] The reverse transaction request response unit is used to respond to the reverse transaction request according to the reverse transaction request message.
[0081] Optionally, based on the above technical solution, the positive transaction flow information further includes fixed field information in the data table; the fixed field information in the data table includes identification information, institutional information, and account identity information; the identification information includes transaction code, service type, system time, global event tracking number, and / or sub-sequence transaction number; and / or the institutional information includes transaction institution, transaction teller, transaction channel, and / or business date; and / or the account identity information includes transaction master account, transaction counterparty account, free trade zone attribute of transaction master account, and / or free trade zone attribute of transaction counterparty account.
[0082] Optionally, based on the above technical solution, the processing device for reversal transactions further includes:
[0083] The information comparison module is used to compare the request message of the reversal transaction with the fixed field information of the matching positive transaction data table.
[0084] Optionally, based on the above technical solution, the reversal transaction request response module 420 is specifically used to respond to the reversal transaction request according to the reversal transaction request message if the request message of the reversal transaction is consistent with the fixed column information of the data table of the positive transaction.
[0085] Optionally, based on the above technical solution, the application scenario area records the calling logic of application components through a runtime stack.
[0086] Optionally, based on the above technical solution, the execution logic of the application component is implemented through execution code.
[0087] Optionally, based on the above technical solution, the associated execution module 430 specifically includes:
[0088] The first associated execution unit is used to set the global event tracking number of the previous transaction of the reversal transaction to the global event tracking number of the matching positive transaction, and to set the sub-transaction sequence number of the previous transaction of the reversal transaction to the sub-transaction sequence number of the positive transaction.
[0089] The second associated execution unit is used to set the global event tracking number of the next transaction of the positive transaction to the global event tracking number of the reverse transaction, and to set the sub-transaction sequence number of the next transaction of the positive transaction to the sub-transaction sequence number of the reverse transaction.
[0090] Optionally, based on the above technical solution, the processing device for reversal transactions further includes:
[0091] The pseudo-positive transaction flow information acquisition module is used to insert pseudo-positive transaction flow information if it is determined that there is no positive transaction flow information matching the reversal transaction request, and respond to the reversal transaction request based on the pseudo-positive transaction flow information;
[0092] The positive transaction request marking module is used to mark the positive transaction request as processed and refuse to respond to the positive transaction request when a positive transaction request matching the reverse transaction request is obtained.
[0093] The above-described apparatus can execute the reversal transaction processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in this embodiment can be found in the methods provided in any embodiment of the present invention.
[0094] Example 5
[0095] Figure 5This is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of the present invention. Figure 5 A block diagram of an exemplary device 12 suitable for implementing embodiments of the present invention is shown. Figure 5 The device 12 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0096] like Figure 5 As shown, device 12 is represented as a general-purpose computing device. Components of device 12 may include, but are not limited to: one or more processors or processing units 16, memory 28, and a bus 18 connecting different system components (including memory 28 and processing unit 16).
[0097] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0098] Device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by device 12, including volatile and non-volatile media, removable and non-removable media.
[0099] Memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (… Figure 5 Not shown; usually referred to as a "hard drive"). Although Figure 5 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0100] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of the present invention.
[0101] Device 12 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable a user to interact with device 12, and / or with any device that enables device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 22. Furthermore, device 12 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with other modules of device 12 via bus 18. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0102] The processing unit 16 executes various functional applications and data processing by running programs stored in the memory 28, such as implementing the reversal transaction processing method provided in this embodiment of the invention. Specifically: when a reversal transaction request is received, it determines whether there is positive transaction flow information matching the reversal transaction request; if it determines that there is positive transaction flow information matching the reversal transaction request, it responds to the reversal transaction request based on the positive transaction flow information; it records the reversal transaction flow information and associates it with the positive transaction flow information.
[0103] Example 6
[0104] Embodiment 6 of the present invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the reversal transaction processing method as described in any embodiment of the present invention; the method includes:
[0105] When a reversal transaction request is received, it is determined whether there is positive transaction flow information that matches the reversal transaction request;
[0106] If it is determined that there is positive transaction flow information that matches the reversal transaction request, then the reversal transaction request is responded to based on the positive transaction flow information;
[0107] Record the reverse transaction flow information and associate it with the positive transaction flow information.
[0108] The computer storage medium of this invention can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0109] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0110] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including—but not limited to—wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0111] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0112] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. A method for processing reversal transactions, characterized in that, include: When a reversal transaction request is received, it is determined whether there is a matching positive transaction log information. This positive transaction log information includes key-value information, fixed field information in a data table, and VARCHAR field information in a data table. The key-value information is stored in a key-value database and used for matching reversal transactions with positive transactions. The key-value information includes a legal entity identifier, a global event tracking number, a sub-transaction sequence number, and a transaction direction identifier. The fixed field information in the data table is stored in a relational database and used for consistency comparison with the request message of the reversal transaction request. The fixed field information in the data table includes identifier information, institution information, and account identity information. The VARCHAR field information in the data table is stored in a relational database; if the VARCHAR field information exceeds the maximum string value... The length of the VARCHAR field information in the data table is determined by splitting it into multiple data entries, with the number of splits indicated by a sequence number in the key-value information. This sequence number reflects the association between the key-value information and the VARCHAR field information in the data table. The VARCHAR field information includes a data length field, a region flag field, a request message area, a response message area, and an application scenario area. The data length field records the length of the VARCHAR field information. The region flag field indicates the existence of the request message area, the response message area, and the application scenario area. The request message area records the request message header and the request message body. The response message area records the response message header and the response message body. The application scenario area records the calling logic of the application component. If it is determined that there is positive transaction flow information that matches the reversal transaction request, then the reversal transaction request is responded to based on the positive transaction flow information; Responding to the reverse transaction request based on the positive transaction flow information includes: A request message for reversing a transaction is generated based on the request message of the positive transaction that matches the reversal transaction request. Respond to the reversal transaction request according to the reversal transaction request message; Record the reverse transaction flow information and associate it with the positive transaction flow information; If it is determined that no positive transaction record information matches the reversal transaction request, then pseudo-positive transaction record information is inserted, and the reversal transaction request is responded to based on the pseudo-positive transaction record information; wherein, the VARCHAR field information and the fixed field information of the data table in the pseudo-positive transaction record information are both blank, and the key-value information in the pseudo-positive transaction record information is constructed based on the key-value information of the positive transaction obtained in the reversal transaction request; the pseudo-positive transaction record information and the positive transaction record information are matched with each other based on the key-value information; When a positive transaction request matching the reversal transaction request is obtained, the positive transaction request is marked as processed, and the positive transaction request is refused to be responded to.
2. The method according to claim 1, characterized in that, The determination of whether there is positive transaction flow information matching the reversal transaction request includes: The reversal transaction request is parsed to obtain the transaction identifier of the positive transaction that matches the reversal transaction request; wherein, the transaction identifier includes a global event tracking number and a sub-transaction sequence number; Based on the transaction identifier of the positive transaction, determine whether there is positive transaction flow information that matches the reverse transaction request.
3. The method according to claim 1, characterized in that, The identification information includes the transaction code, service type, and system time; The institutional information includes the trading institution, trading teller, trading channel, and / or business date; The account identity information includes the main transaction account, the counterparty account, the free trade zone attribute of the main transaction account, and / or the free trade zone attribute of the counterparty account.
4. The method according to claim 3, characterized in that, Before responding to the reversal transaction request based on the positive transaction flow information, the process also includes: The request message for the reversal transaction is compared with the fixed field information of the matching positive transaction data table; The step of responding to the reverse transaction request based on the positive transaction flow information includes: If the request message for the reversal transaction matches the fixed field information in the data table of the positive transaction, then the reversal transaction request is responded to according to the request message for the reversal transaction.
5. The method according to claim 1, characterized in that, The application scenario area records the calling logic of application components through the runtime stack.
6. The method according to claim 5, characterized in that, The execution logic of the application component is implemented through executable code.
7. The method according to claim 1, characterized in that, The recording of reverse transaction flow information and its association with the positive transaction flow information includes: Set the global event tracking number of the previous transaction of the reversal transaction to the global event tracking number of the matching positive transaction, and set the sub-transaction sequence number of the previous transaction of the reversal transaction to the sub-transaction sequence number of the positive transaction. Set the global event tracking number of the next transaction of the positive transaction to the global event tracking number of the reverse transaction, and set the sub-transaction number of the next transaction of the positive transaction to the sub-transaction number of the reverse transaction.
8. A processing device for reversal transactions, characterized in that, include: The positive transaction log information judgment module is used to determine whether there is positive transaction log information matching the reversal transaction request when a reversal transaction request is received. The positive transaction log information includes key-value information, fixed field information in a data table, and VARCHAR field information in a data table. The key-value information is stored in a key-value database and is used for matching reversal transactions with positive transactions. The key-value information includes legal entity identification, global event tracking number, sub-transaction sequence number, and transaction direction identification. The fixed field information in the data table is stored in a relational database and is used for consistency comparison with the request message of the reversal transaction request. The fixed field information in the data table includes identification information, institution information, and account identity information. The VARCHAR field information in the data table is stored in a relational database. If the VARCHAR field information... If the string length exceeds the maximum, the VARCHAR field information in the data table is split into multiple data entries, and the number of splits is indicated by the sequence number in the key-value information. The sequence number reflects the association between the key-value information and the VARCHAR field information in the data table. The VARCHAR field information in the data table includes a data length bit, a region flag bit, a request message area, a response message area, and an application scenario area. The data length bit is used to record the length of the VARCHAR field information in the data table. The region flag bit is used to record whether the requested message area, the response message area, and the application scenario area exist. The request message area is used to record the request message header and the request message body. The response message area is used to record the response message header and the response message body. The application scenario area is used to record the calling logic of the application component. The reverse transaction request response module is used to respond to the reverse transaction request based on the positive transaction flow information if it is determined that there is positive transaction flow information that matches the reverse transaction request. The reversal transaction request response module specifically includes: The request message generation unit is used to generate a request message for a reverse transaction based on the request message of the positive transaction that matches the reverse transaction request. A reversal transaction request response unit is used to respond to the reversal transaction request according to the reversal transaction request message; The associated execution module is used to record the reverse transaction flow information and associate it with the positive transaction flow information; The pseudo-positive transaction log information acquisition module is used to insert pseudo-positive transaction log information if it is determined that no positive transaction log information matching the reversal transaction request exists, and to respond to the reversal transaction request based on the pseudo-positive transaction log information; wherein, the VARCHAR field information and the fixed field information of the data table in the pseudo-positive transaction log information are both blank; the key-value information in the pseudo-positive transaction log information is constructed based on the key-value information of the positive transaction obtained in the reversal transaction request; the pseudo-positive transaction log information and the positive transaction log information are matched with each other based on the key-value information; The positive transaction request marking module is used to mark the positive transaction request as processed and refuse to respond to the positive transaction request when a positive transaction request matching the reverse transaction request is obtained.
9. An electronic device, characterized in that, The electronic device includes: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the reversal transaction processing method as described in any one of claims 1-7.
10. A storage medium comprising computer-executable instructions, which, when executed by a computer processor, are used to perform a reversal transaction processing method as described in any one of claims 1-7.
Citation Information
Patent Citations
Citation reprinting method and citation reprinting device
CN111124325A
Reversal transaction processing method and device
CN111369350A