Refund processing method, device, equipment, storage medium and computer program product
By determining the target database for order storage based on the time difference between the transaction time of the order from the current time, the problem of low efficiency in refund service processing in the distributed architecture is solved, and the efficiency and data consistency of refund processing are improved.
Patent Information
- Application Number
- CN202411592150.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-04-01
AI Technical Summary
In distributed architecture, the processing efficiency of refund services is low, especially when there are many databases, which leads to large consumption of I/O resources, large network bandwidth usage, and low query efficiency, which easily leads to processing bottlenecks.
By determining the target database for order storage based on the time difference between the order's transaction time and the current time, the efficiency of querying in refund processing is improved. The specific steps include receiving a refund request, obtaining a target order, determining the transaction time and time difference, determining the target database based on the time difference, obtaining initial transaction information and forwarding it to the initial database for refund processing.
It improves the efficiency of refund processing for payment transaction orders, ensures that the original payment transaction and refund processing of the target order are executed in one transaction, and ensures the integrity of the operation and the consistency of the data.
Smart Images

Figure CN119741020A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data management technology, and in particular to refund processing methods, devices, equipment, storage media and computer program products. Background Art
[0002] In current payment transaction application systems, distributed architecture is mostly used because it has good scalability and high availability. Distributed architecture has scenarios such as split database sub-library and microservices. For payment business systems, payment transactions within one year generally need to support refunds. Refund business processing strongly relies on the original payment transaction data. In a distributed architecture, how to get from the refund request to the location of the original payment transaction (microservice or sub-library) is a problem that must be solved.
[0003] Taking the scenario of splitting database as an example, the current routing solution for refund transactions is usually to ensure business continuity. Payment transactions can adopt a random multi-active routing method. When payment transactions are randomly distributed in various sub-databases, processing refund transactions requires parallel query of all sub-databases, and the original payment transaction is determined based on the query results. The disadvantage of this solution is that when there are many sub-databases, a business request will consume more I / O resources of the application instance, the communication process will occupy more network bandwidth, and the more sub-databases there are, the lower the query efficiency, which is prone to processing bottlenecks.
[0004] Therefore, there is an urgent need for a method to improve the efficiency of refund processing.
[0005] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0006] The main purpose of this application is to provide a refund processing method, device, equipment, storage medium and computer program product, aiming to solve the technical problem of low efficiency of payment transaction order refund business.
[0007] To achieve the above purpose, this application proposes a refund processing method, which includes:
[0008] Receive a refund request and obtain a target order corresponding to the refund request;
[0009] Determine the transaction time according to the target order, and obtain the time difference between the transaction time and the current time;
[0010] Determining a target database where the target order is stored based on a time difference between the transaction time and the current time;
[0011] Acquire initial transaction information of the order according to the target database corresponding to the target order, and determine the initial sub-database where the order information is stored when the target order completes the transaction according to the initial transaction information;
[0012] The initial transaction information is forwarded to the initial sub-database, and a refund process for the target order is performed in the initial sub-database according to the initial transaction information.
[0013] In one embodiment, the step of determining the target database where the target order is stored based on the time difference between the transaction time and the current time includes:
[0014] Compare the time difference between the transaction time and the current time with the preset time threshold to determine the order type of the target order;
[0015] According to the order type of the target order, a target database for storing the initial transaction information of the target order is determined.
[0016] In one embodiment, the step of comparing the time difference between the transaction time and the current time with a preset time threshold to determine the order type of the target order includes:
[0017] When the time difference between the transaction time and the current time is greater than a preset time threshold, the order type of the target order is the first order;
[0018] When the time difference between the transaction time and the current time is less than or equal to a preset time threshold, the order type of the target order is a second order.
[0019] In one embodiment, the step of determining, according to the order type of the target order, the target database in which the initial transaction information of the target order is stored comprises:
[0020] When the order type of the target order is the first order, the target database for storing the initial transaction information of the target order is a historical database;
[0021] When the order type of the target order is the second order, the target sub-database information stored in the initial transaction information of the target order is obtained from the routing storage system.
[0022] In one embodiment, the method further comprises:
[0023] The target sub-database information corresponding to the order belonging to the second order is recorded in the routing storage system, and the routing storage system includes a main routing storage library and / or a backup routing storage library.
[0024] In one embodiment, when the order type of the target order is the second order, the step of obtaining the target sub-database information stored in the initial transaction information of the target order from the routing storage system includes:
[0025] Querying the target sub-database of the target order through the main routing storage library of the routing storage system;
[0026] When querying the target sub-database of the target order from the main routing storage library fails, querying the target sub-database of the target order through the backup routing storage library of the routing storage system;
[0027] When the query of the target sub-database of the target order from the backup routing storage library fails, the target sub-database where the initial transaction information of the target order is located is obtained by querying the basic sub-database recorded in the routing storage system in parallel.
[0028] In addition, to achieve the above purpose, the present application also proposes a refund processing device, the refund processing device comprising:
[0029] An order acquisition module is used to receive a refund request and acquire a target order corresponding to the refund request;
[0030] A time difference acquisition module, used to determine the transaction time according to the target order, and obtain the time difference between the transaction time and the current time;
[0031] A target determination module, used for determining a target database where the target order is stored based on a time difference between a transaction time and a current time;
[0032] An initial sub-library module, used to obtain initial transaction information of the order according to the target database corresponding to the target order, and determine the initial sub-library where the order information is stored when the target order is completed according to the initial transaction information;
[0033] The refund processing module is used to forward the initial transaction information to the initial sub-database, and perform refund processing of the target order in the initial sub-database according to the initial transaction information.
[0034] In addition, to achieve the above-mentioned purpose, the present application also proposes a refund processing device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the refund processing method described above.
[0035] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the refund processing method described above are implemented.
[0036] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the refund processing method described above are implemented.
[0037] One or more technical solutions proposed in this application have at least the following technical effects:
[0038] The embodiment of the present application proposes a refund processing method, device, equipment, storage medium and computer program product, which receives a refund request and obtains a target order corresponding to the refund request; determines the transaction time according to the target order and obtains the time difference between the transaction time and the current time; determines the target database where the target order is stored based on the time difference between the transaction time and the current time; obtains the initial transaction information of the order according to the target database corresponding to the target order, and determines the initial sub-database where the order information is stored when the target order completes the transaction according to the initial transaction information; forwards the initial transaction information to the initial sub-database, and performs refund processing for the target order in the initial sub-database according to the initial transaction information. The present application improves the refund service efficiency in the refund processing of payment transaction orders by determining the target database for order storage according to the time difference between the transaction time of the order and the current time. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0041] Figure 1 A flowchart of the first embodiment of the refund processing method for this application is provided;
[0042] Figure 2 A schematic diagram of the mapping relationship between the sub-library identifier of the target sub-library and the actual sub-library provided in the embodiment of the refund processing method for the present application;
[0043] Figure 3 This is a flow chart of a refund processing method with 90 days as the time threshold in an embodiment of the present application;
[0044] Figure 4 This is a schematic diagram of the module structure of the refund processing device in the embodiment of the present application;
[0045] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the refund processing method in the embodiment of the present application.
[0046] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0047] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0048] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0049] The main solution of the embodiment of the present application is: receiving a refund request, and obtaining a target order corresponding to the refund request; determining the transaction time according to the target order, and obtaining the time difference between the transaction time and the current time; determining the target database where the target order is stored based on the time difference between the transaction time and the current time; obtaining the initial transaction information of the order according to the target database corresponding to the target order, and determining the initial sub-database where the order information is stored when the target order completes the transaction according to the initial transaction information; forwarding the initial transaction information to the initial sub-database, and performing a refund process for the target order in the initial sub-database according to the initial transaction information.
[0050] In this embodiment, for ease of description, the following description is made by taking identification of the refund processing device as the execution entity.
[0051] Since the distributed architecture is mostly used in the current payment transaction application system, because the distributed architecture has good scalability and high availability, the distributed architecture has scenarios such as splitting the database and microservices. For the payment business system, generally, payment transactions within one year need to support refunds. The refund business processing is highly dependent on the original payment transaction data. How to get the refund request to the location of the original payment transaction (microservice or sub-database) in the distributed architecture is a problem that must be solved.
[0052] Taking the scenario of splitting database as an example, the current routing solution for refund transactions is usually to ensure business continuity. Payment transactions can adopt a random multi-active routing method. When payment transactions are randomly distributed in various sub-databases, processing refund transactions requires parallel query of all sub-databases, and determining the sub-database where the original payment transaction is located based on the query results. The disadvantage of this solution is that when there are many sub-databases, a business request will consume more I / O resources of the application instance, the communication process will occupy more network bandwidth, and the more sub-databases there are, the lower the query efficiency is, which is prone to processing bottlenecks. Therefore, there is an urgent need for a method to improve the efficiency of refund processing.
[0053] This application improves the efficiency of queries in refund processing by determining the target database for order storage based on the time difference between the transaction time of the order and the current time.
[0054] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a refund processing device, etc. The following takes the refund processing device as an example to illustrate this embodiment and the following embodiments.
[0055] Based on this, the present application embodiment provides a refund processing method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the refund processing method.
[0056] In this embodiment, the refund processing method includes steps S10 to S50:
[0057] Step S10, receiving a refund request, and obtaining a target order corresponding to the refund request.
[0058] It should be noted that the refund request is a request initiated by a user, merchant or payment platform to refund part or all of the amount of a previously completed transaction. The refund request contains sufficient information to identify the corresponding order, including but not limited to the order identifier.
[0059] In addition, it should be noted that the target order refers to the order corresponding to the received refund request, which is uniquely identified by the order identifier, which is used to uniquely identify a transaction or order. The order identifier may be an order number, a transaction ID, or any other identifier that can accurately point to a specific transaction, and is used to locate and find all transaction information and historical records related to the order in the system. In one embodiment of the present application, the order identifier is the order number.
[0060] Specifically, the third party initiates a refund request to the device. After receiving the refund request, the device analyzes and obtains the order identifier and transaction time in the refund request, and obtains the corresponding target order according to the order identifier.
[0061] Step S20, determining the transaction time according to the target order, and obtaining the time difference between the transaction time and the current time.
[0062] It should be noted that the transaction time refers to the specific time point when the target order transaction is completed. The transaction time point is usually automatically recorded by the system after the user places an order and completes the payment.
[0063] In addition, it should be noted that the current time refers to the specific time point when the refund request is received and processed. This time point is automatically obtained by the system and usually occurs simultaneously with the user's refund operation.
[0064] Specifically, the transaction time of the completed transaction of the order is obtained according to the target order, the current time of receiving the refund request is obtained, and the time difference of the target order is obtained by subtracting the transaction time from the current time.
[0065] Step S30, determining the target database where the target order is stored based on the time difference between the transaction time and the current time.
[0066] It should be noted that the target database refers to the database where the specific transaction information of the target order corresponding to the refund request is currently stored. The target database may be a target sub-database recorded by the routing storage system, or it may be a historical database.
[0067] Specifically, the time difference between the transaction time and the current time is compared with a preset time threshold to determine the order type of the target order; and according to the order type of the target order, the target database in which the initial transaction information of the target order is stored is determined.
[0068] Step S40, obtaining initial transaction information of the order according to the target database corresponding to the target order, and determining the initial sub-database where the order information is stored when the target order completes the transaction according to the initial transaction information.
[0069] It should be noted that the initial transaction information refers to the original transaction data recorded when the target order is just completed, and refers to all relevant information recorded when the payment transaction occurs. The initial transaction information includes but is not limited to basic transaction information, payer information, payee information, product / service information, other information and other information. The basic transaction information includes but is not limited to order ID (an ID that uniquely identifies each order), transaction time (the specific time when the transaction occurs), transaction amount (the amount of the transaction), transaction status (such as paid, unpaid, refunded, etc.), and the initial sub-database when the transaction is completed (the database where the original transaction data is just generated); payer information includes but is not limited to payer account number (account information for payment, such as bank card number, third-party payment account, etc.), payer name or nickname, payer contact information (mobile phone number, etc.); payee information includes but is not limited to payee account (account information for receiving payment), payee name or merchant name; product / service information includes but is not limited to product / service description, quantity of products / services, and unit price of products / services; other information includes but is not limited to transaction notes, transaction channels and other information.
[0070] In addition, it should be noted that the initial sub-database refers to the database where the original transaction data of the target order is located when it is just generated.
[0071] Specifically, according to the order number of the target order, the initial transaction information is queried from the target database corresponding to the target order. The initial transaction information includes but is not limited to basic transaction information, payer information, payee information, product / service information, other information, etc. When the completed transaction of the target order is extracted from the initial transaction information, the location of the initial sub-database where the initial transaction information is stored is obtained.
[0072] Step S50, forwarding the initial transaction information to the initial sub-database, and performing a refund process for the target order in the initial sub-database according to the initial transaction information.
[0073] Specifically, a connection is established between the target database and the initial sub-database, and the prepared initial transaction information is sent to the initial sub-database through the database connection. The initial sub-database receives the forwarded initial transaction information and verifies the received transaction information to ensure that the information is accurate and meets the conditions for refund. When the verification is passed, the sub-database will perform a refund operation based on the initial transaction information, which may include updating the order status in the database, reducing the seller's account balance, increasing the buyer's account balance, etc. After the refund operation is completed, the system will record the detailed information of the refund operation in the database, including the refund time, refund amount, etc., for subsequent audits and inquiries. Finally, the system will notify the relevant parties (such as buyers and sellers) that the refund operation has been completed, which is usually achieved through email, SMS or in-app notifications.
[0074] This application improves the refund business efficiency in the refund processing of payment transaction orders by determining the target database for order storage based on the time difference between the order transaction time and the current time; by determining the initial sub-database of the target order and performing the refund processing in the initial sub-database, it can ensure that the original payment transaction and refund processing of the target order are executed in one transaction, thereby ensuring the integrity of the operation and the consistency of the data.
[0075] Based on the above implementation scheme, in a feasible implementation manner, determining the target database where the target order is stored based on the time difference between the transaction time and the current time includes steps S31 to S32:
[0076] Step S31, comparing the time difference between the transaction time and the current time with a preset time threshold to determine the order type of the target order.
[0077] It should be noted that the preset time threshold is a pre-set time limit or standard used to distinguish the order type of the target order. Specifically, this time threshold is used to compare the time difference between the transaction time of the target order and the current time to determine whether the order belongs to the first order or the second order. The preset time threshold can be 10 days, 30 days, 60 days, 90 days, 120 days and other time data, which is not limited in this application.
[0078] In addition, it should be noted that the order type refers to the classification of orders according to the time difference between the transaction time of the target order and the current time.
[0079] Specifically, when the time difference between the transaction time and the current time is greater than a preset time threshold, the order type of the target order is a first order; when the time difference between the transaction time and the current time is less than the preset time threshold, the order type of the target order is a second order.
[0080] Step S32: determining the target database where the initial transaction information of the target order is stored according to the order type of the target order.
[0081] Specifically, when the order type of the target order is a first order, the target database storing the initial transaction information of the target order is a historical database; when the order type of the target order is a second order, the target sub-database information storing the initial transaction information of the target order is obtained from the routing storage system.
[0082] Based on the above implementation scheme, in a feasible implementation manner, comparing the time difference between the transaction time and the current time with a preset time threshold to determine the order type of the target order includes steps S311 to S312:
[0083] Step S311, when the time difference between the transaction time and the current time is greater than a preset time threshold, the order type of the target order is the first order.
[0084] It should be noted that the first order refers to an order whose transaction time has a time difference greater than a preset time threshold from the current time, that is, a payment transaction order that is farther from the current time has a lower refund frequency. Because the overall refund frequency of orders that are farther from the current time is lower, and the overall refund frequency of orders that are closer to the current time is higher, this application classifies the target orders according to the time difference between the transaction time and the current time.
[0085] Specifically, when the time difference between the transaction time and the current time is greater than a preset time threshold, the order type of the target order is a first order. In one embodiment of the present application, the preset time threshold is 90 days, and the order type of the target order with a time difference greater than 90 days is a first order.
[0086] Step S312: when the time difference between the transaction time and the current time is less than or equal to a preset time threshold, the order type of the target order is a second order.
[0087] It should be noted that the second order refers to an order whose transaction time has a time difference from the current time that is less than or equal to a preset time threshold, that is, payment transaction orders that are closer to the current time have a higher frequency of refunds.
[0088] Specifically, when the time difference between the transaction time and the current time is less than or equal to the preset time threshold, the order type of the target order is the second order. In one embodiment of the present application, the preset time threshold is 90 days, and the order type of the target order with a time difference less than or equal to 90 days is the second order.
[0089] More specifically, considering that the migration of payment transaction order data from the current database to the historical database cannot be completed instantly, and that there may be a deviation between the time base of the transaction time of the original payment transaction order and the time base of the current time, a certain error tolerance should be reserved before and after the preset time threshold boundary, so the time difference is divided into a separate interval near the preset time threshold, and the time is actually divided into 3 intervals. When the target database of the target order with a time difference near the preset time threshold is obtained, the target sub-database information where the initial transaction information of the target order is stored is first obtained from the routing storage system. If the query fails, the target sub-database where the initial transaction information of the target order is located is obtained by querying the basic sub-database recorded in the routing storage system in parallel. If the query still fails, the initial transaction information of the target order is queried from the historical database.
[0090] For example, when the time threshold is 90 and the error tolerance is 2 days, the time intervals are within 88 days (including 88 days), outside 92 days (including 92 days), and between 88 days and 92 days.
[0091] In one embodiment of the present application, when a refund request is received for a transaction paid 10 days ago, the routing information is first queried from the routing storage system to obtain the information of the target database. If the query is successful, subsequent forwarding and refund processing are performed. If it fails, the target sub-database where the initial transaction information of the target order is located is obtained by parallelly querying the basic sub-database recorded in the routing storage system. If the query is successful, subsequent forwarding and refund processing are performed; otherwise, an error is reported and the system exits.
[0092] When receiving a refund request for a payment transaction order from 100 days ago, the initial transaction information of the target order is directly queried from the historical database. If the query is successful, the subsequent forwarding and refund processing will be carried out; otherwise, an error will be reported and the system will exit.
[0093] When a refund request is received for a payment transaction order made 91 days ago, the target sub-database information storing the initial transaction information of the target order is first obtained from the routing storage system. If the query fails, the target sub-database where the initial transaction information of the target order is located is obtained by parallelly querying the basic sub-database recorded in the routing storage system. If the query still fails, the initial transaction information of the target order is queried from the historical database. After the query is successful, subsequent forwarding and refund processing are performed; otherwise, an error is reported and the system exits.
[0094] For better understanding, please refer to Figure 3 , Figure 3 The flowchart of the refund processing method of the embodiment with 90 days as the time threshold is shown. When receiving the refund request from the user, the time difference between the transaction time of the target order corresponding to the refund request and the current time is determined, and whether the time difference is greater than 92 days. If it is greater than 92 days, the initial transaction information of the target order is directly queried from the historical database. After the query is successful, the subsequent forwarding and refund processing are performed; otherwise, an error is reported and the system exits. If the time difference is less than 92 days, it is determined whether the time difference is within 88 days. If so, the routing information is first queried from the routing storage system to obtain the information of the target database. If the information can be queried, the subsequent forwarding and refund processing are performed. If it fails, the target sub-database where the initial transaction information of the target order is located is obtained by parallelly querying the basic sub-database recorded in the routing storage system. If the information can be queried, the subsequent forwarding and refund processing are performed; otherwise, an error is reported and the system exits. If the time difference is less than 92 days and greater than 88 days, first obtain the target sub-database information where the initial transaction information of the target order is stored from the routing storage system. If the query fails, obtain the target sub-database where the initial transaction information of the target order is located by parallelly querying the basic sub-database recorded in the routing storage system. If the query still fails, query the initial transaction information of the target order from the historical database. After the query is successful, perform subsequent forwarding and refund processing; otherwise, report an error and exit.
[0095] This application divides the order types according to the time difference and uses different storage methods to store data. The order data with a high refund frequency in the near future is stored in a sub-database with faster query speed, and the orders with a longer time are stored in a large-capacity column-based database as a historical database. This can reduce costs and improve the query efficiency of refund business. By setting the fault tolerance difference near the time threshold, the fault tolerance rate and reliability of the equipment can be improved.
[0096] Based on the above implementation scheme, in a feasible implementation manner, determining the target database where the initial transaction information of the target order is stored according to the order type of the target order includes steps S321 to S322:
[0097] Step S321, when the order type of the target order is the first order, the target database for storing the initial transaction information of the target order is a historical database.
[0098] It should be noted that the historical database refers to a database storing order information of the first order type.
[0099] Specifically, when the time difference between the transaction time and the current time is greater than a preset time threshold, the order type of the target order is determined to be a first order, and it can be determined that the initial transaction information of the target order is stored in the history database.
[0100] Step S322: when the order type of the target order is the second order, the target sub-database information stored in the initial transaction information of the target order is obtained from the routing storage system.
[0101] It should be noted that the routing storage system is used to store and query the routing information of recent payment transaction orders, that is, to record the routing information of the second order. The routing storage system does not need to record the complete information of the order, but only records the sub-library identifier of the target sub-library associated with each order, and the actual sub-library corresponding to the sub-library identifier, to provide routing information query services. In order to ensure high availability, the routing storage system adopts active-active deployment, including a main routing storage repository and a backup routing storage repository. The routing information of each order will be stored in both the main routing storage repository and the backup routing storage repository. When each order is completed, the routing information is written to the routing storage system in an asynchronous dual-write manner. When querying the routing information, first query the main routing storage repository. If the query fails, switch to query the backup routing storage repository.
[0102] Specifically, when the time difference between the transaction time and the current time is less than or equal to the preset time threshold, the order type of the target order is a second order, and the target sub-library information stored in the initial transaction information of the target order can be obtained from the routing storage system.
[0103] More specifically, the mapping relationship between the sub-database ID of the target sub-database associated with an order and the actual sub-database is mainly used to cope with the scenario of data migration of the existing database. After the data migration, only the sub-database mapped by the sub-database ID needs to be adjusted. In addition, it also provides convenience for coping with the scenario of database expansion. A new sub-database ID can be added to the new sub-database without affecting the existing sub-database ID and existing transactions. Figure 2 The figure shows the mapping relationship between the sub-library identifier of the target sub-library and the actual sub-library. Figure 2The current database in refers to the target database, (primary) routing storage refers to the primary routing storage library, (backup) routing storage refers to the backup routing storage library, and the current database 01 transaction refers to the transaction order data stored in the target database 01. The target database has three sub-databases 01, 02, and 03, so the routing information of their original payment transaction order information in the routing storage system is: the sub-database identification of the payment transaction of the target database 01 is 001 (corresponding to the target database 01), the sub-database identification of the payment transaction of the target database 02 is 002 (corresponding to the target database 02), and the sub-database identification of the payment transaction of the target database 03 is 003 (corresponding to the target database 03). When the data of sub-database 01 is migrated to sub-database 03, the corresponding sub-database of sub-database ID 001 needs to be adjusted to sub-database 03. At this time, the actual sub-database corresponding to sub-database ID 001 is sub-database 03; and when sub-database 04 is added or expanded, sub-database ID 004 (corresponding to sub-database 04) needs to be added. The transactions occurring in the current database 04 are stored in the routing storage system with sub-database ID 004. Regardless of data migration or adding or expanding sub-databases, the new and old payment transactions occurring in the target databases 02 and 03 will retain the original sub-database ID, and the routing process of the refund transaction will not be affected.
[0104] More specifically, the routing storage system is mainly used to query the refund information of recent payment transaction orders. Therefore, according to the time division, only the routing information of payment transaction orders within the preset time threshold needs to be stored. The order information with a time difference exceeding the time threshold is transferred to the historical database, and then the routing information in the basic sub-database is cleaned up in time, which can effectively control the library storage capacity of the basic sub-database.
[0105] Based on the above implementation, in a feasible implementation, the method further includes step S60:
[0106] Step S60, recording the target sub-database information corresponding to the order belonging to the second order in the routing storage system, wherein the routing storage system includes a main routing storage library and / or a backup routing storage library.
[0107] Specifically, the routing storage system adopts active-active dual deployment, including a primary routing repository and a backup routing repository. The routing information of each order will be stored in the primary routing repository and the backup routing repository. When each order is completed, the routing information is written to the primary routing repository and the backup routing repository of the routing storage system in an asynchronous dual-write manner. When querying routing information, first query the primary routing repository. If no result is found, switch to query the backup routing repository.
[0108] Based on the above implementation scheme, in a feasible implementation mode, when the order type of the target order is the second order, the step of obtaining the target sub-database information stored in the initial transaction information of the target order from the routing storage system includes steps A211 to A213:
[0109] Step A211, querying the target sub-database of the target order through the main routing storage library of the routing storage system.
[0110] Specifically, the main routing repository is accessed, and the target sub-library information currently stored in the order is queried according to the order information of the target order. If the query is successful, the target sub-library information is returned. If the query fails, the target sub-library of the target order is queried through the backup routing repository of the routing storage system.
[0111] Step A212: when the query of the target sub-database of the target order from the main routing storage library fails, the query of the target sub-database of the target order is performed through the backup routing storage library of the routing storage system.
[0112] Specifically, when the query of the target sub-library of the target order from the main routing repository fails, the backup routing repository is accessed to query the target sub-library information currently stored in the order based on the order information of the target order. If the query is successful, the target sub-library information is returned. If the query fails, the target sub-library where the initial transaction information of the target order is located is obtained by parallelly querying all sub-libraries recorded in the routing storage system.
[0113] Step A213, when the query of the target sub-database of the target order from the backup routing storage library fails, the target sub-database where the initial transaction information of the target order is located is obtained by parallelly querying the basic sub-database recorded in the routing storage system.
[0114] It should be noted that the basic sub-database refers to all sub-databases recorded in the routing storage system, that is, the data sub-database storing the second order data.
[0115] Specifically, when the query of the target sub-library of the target order from the backup routing storage library fails, a list of all basic sub-libraries recorded in the routing storage system is obtained, parallel query tasks are prepared, a query task is assigned to each data sub-library in the basic sub-libraries, and query requests are sent to all basic sub-libraries at the same time. The initial transaction information is queried according to the identifier of the target order, the query results of all basic sub-libraries are collected, and it is checked whether there is a basic sub-library that has returned the initial transaction information of the target order. If a basic sub-library containing the initial transaction information is found, the basic sub-library is determined to be the target database.
[0116] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the refund processing method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0117] This application also provides a refund processing device, please refer to Figure 4 , the refund processing device comprises:
[0118] The order acquisition module 401 is used to receive a refund request and acquire a target order corresponding to the refund request;
[0119] A time difference acquisition module 402 is used to determine the transaction time according to the target order and obtain the time difference between the transaction time and the current time;
[0120] A target determination module 403, for determining a target database where the target order is stored based on a time difference between a transaction time and a current time;
[0121] The initial sub-database module 404 is used to obtain the initial transaction information of the order according to the target database corresponding to the target order, and determine the initial sub-database where the order information is stored when the target order is completed according to the initial transaction information;
[0122] The refund processing module 405 is used to forward the initial transaction information to the initial sub-database, and perform refund processing of the target order in the initial sub-database according to the initial transaction information.
[0123] The refund processing device provided by this application adopts the refund processing method in the above embodiment, which can solve the technical problem of low efficiency of refund business of payment transaction orders. Compared with the prior art, the beneficial effects of the refund processing device provided by this application are the same as the beneficial effects of the refund processing method provided by the above embodiment, and the other technical features in the refund processing device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0124] The present application provides a refund processing device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the refund processing method in the above-mentioned embodiment one.
[0125] Reference below Figure 5 , which shows a schematic diagram of the structure of a refund processing device suitable for implementing the embodiment of the present application. The refund processing device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5The refund processing device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0126] like Figure 5 As shown, the refund processing device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the refund processing device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the refund processing device to communicate with other devices wirelessly or by wire to exchange data. Although the refund processing device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0127] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0128] The refund processing device provided by this application adopts the refund processing method in the above embodiment, which can solve the technical problem of low efficiency of refund business of payment transaction orders. Compared with the prior art, the beneficial effects of the refund processing device provided by this application are the same as the beneficial effects of the refund processing method provided by the above embodiment, and the other technical features in the refund processing device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0129] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0130] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0131] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the refund processing method in the above-mentioned embodiment.
[0132] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0133] The computer-readable storage medium may be included in the refund processing device; or may exist independently without being assembled into the refund processing device.
[0134] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the refund processing device, the refund processing device: receives a refund request and obtains a target order corresponding to the refund request; determines the transaction time according to the target order and obtains the time difference between the transaction time and the current time; determines the target database where the target order is stored based on the time difference between the transaction time and the current time; obtains the initial transaction information of the order according to the target database corresponding to the target order, and determines the initial sub-database where the order information is stored when the target order completes the transaction according to the initial transaction information; forwards the initial transaction information to the initial sub-database, and performs refund processing for the target order in the initial sub-database according to the initial transaction information.
[0135] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0136] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0137] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0138] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned refund processing method, and can solve the technical problem of low efficiency of the refund business of payment transaction orders. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the refund processing method provided by the above-mentioned embodiment, and will not be repeated here.
[0139] The present application also provides a computer program product, including a computer program, which implements the steps of the refund processing method as described above when executed by a processor.
[0140] The computer program product provided by this application can solve the technical problem of low efficiency of payment transaction order refund business. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the refund processing method provided by the above embodiment, which will not be repeated here.
[0141] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A refund processing method, characterized in that: The method comprises: Receive a refund request and obtain a target order corresponding to the refund request; Determine the transaction time according to the target order, and obtain the time difference between the transaction time and the current time; Determining a target database where the target order is stored based on a time difference between the transaction time and the current time; Acquire initial transaction information of the order according to the target database corresponding to the target order, and determine the initial sub-database where the order information is stored when the target order completes the transaction according to the initial transaction information; The initial transaction information is forwarded to the initial sub-database, and a refund process for the target order is performed in the initial sub-database according to the initial transaction information.
2. The method according to claim 1, characterized in that The step of determining the target database where the target order is stored based on the time difference between the transaction time and the current time comprises: Compare the time difference between the transaction time and the current time with the preset time threshold to determine the order type of the target order; According to the order type of the target order, a target database for storing the initial transaction information of the target order is determined.
3. The method according to claim 2, characterized in that The step of comparing the time difference between the transaction time and the current time with a preset time threshold to determine the order type of the target order includes: When the time difference between the transaction time and the current time is greater than a preset time threshold, the order type of the target order is the first order; When the time difference between the transaction time and the current time is less than or equal to a preset time threshold, the order type of the target order is a second order.
4. The method according to claim 2, characterized in that The step of determining the target database where the initial transaction information of the target order is stored according to the order type of the target order comprises: When the order type of the target order is the first order, the target database for storing the initial transaction information of the target order is a historical database; When the order type of the target order is the second order, the target sub-database information stored in the initial transaction information of the target order is obtained from the routing storage system.
5. The method according to claim 4, characterized in that The method further comprises: The target sub-database information corresponding to the order belonging to the second order is recorded in the routing storage system, and the routing storage system includes a main routing storage library and / or a backup routing storage library.
6. The method according to claim 4, characterized in that When the order type of the target order is the second order, the step of obtaining the target sub-database information stored in the initial transaction information of the target order from the routing storage system includes: Querying the target sub-database of the target order through the main routing storage library of the routing storage system; When querying the target sub-database of the target order from the main routing storage library fails, querying the target sub-database of the target order through the backup routing storage library of the routing storage system; When the query of the target sub-database of the target order from the backup routing storage library fails, the target sub-database where the initial transaction information of the target order is located is obtained by querying the basic sub-database recorded in the routing storage system in parallel.
7. A refund processing device, characterized in that: The device comprises: An order acquisition module is used to receive a refund request and acquire a target order corresponding to the refund request; A time difference acquisition module, used to determine the transaction time according to the target order, and obtain the time difference between the transaction time and the current time; A target determination module, used for determining a target database where the target order is stored based on a time difference between a transaction time and a current time; An initial sub-library module, used to obtain initial transaction information of the order according to the target database corresponding to the target order, and determine the initial sub-library where the order information is stored when the target order is completed according to the initial transaction information; The refund processing module is used to forward the initial transaction information to the initial sub-database, and perform refund processing of the target order in the initial sub-database according to the initial transaction information.
8. A refund processing device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the refund processing method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the refund processing method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the refund processing method according to any one of claims 1 to 6 are implemented.