WO2019024583A1 - 交易回滚方法、装置、计算机设备和存储介质 - Google Patents

交易回滚方法、装置、计算机设备和存储介质 Download PDF

Info

Publication number
WO2019024583A1
WO2019024583A1 PCT/CN2018/088569 CN2018088569W WO2019024583A1 WO 2019024583 A1 WO2019024583 A1 WO 2019024583A1 CN 2018088569 W CN2018088569 W CN 2018088569W WO 2019024583 A1 WO2019024583 A1 WO 2019024583A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
rollback
target
identifier
status
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2018/088569
Other languages
English (en)
French (fr)
Inventor
刘星
仝西乐
罗佳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Publication of WO2019024583A1 publication Critical patent/WO2019024583A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operations
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1438Restarting or rejuvenating
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Definitions

  • the application relates to a transaction rollback method, apparatus, computer device and storage medium.
  • Transaction rollback refers to the fact that after the customer directly or indirectly conducts the product trading transaction on the Internet (such as fund trading), the data obtained after the execution of the transaction becomes meaningless due to the change of the trading parameters (such as the change in the net value of the unit on the day of the fund transaction).
  • the share of the fund purchased by the user has changed, and the fund share obtained by executing the fund transaction is no longer useful, so that the data obtained after the execution of the transaction needs to be restored to the last correct state.
  • the traditional transaction rollback method is to perform full rollback of batch transactions after all the received batch transactions are executed.
  • the inventors realized that when the number of batch transactions is large, the full rollback of the transaction takes a long time, making the transaction rollback inefficient.
  • a transaction rollback method In accordance with various embodiments disclosed herein, a transaction rollback method, apparatus, computer device, and storage medium are provided.
  • a transaction rollback method including:
  • the rollback mode is a partial rollback carrying a filter condition and a transaction batch identifier, screening a target transaction that satisfies the screening condition from a transaction corresponding to the transaction batch identifier;
  • the target transaction is rolled back.
  • a transaction rollback device comprising:
  • a transaction rollback instruction receiving module configured to receive a transaction rollback instruction, where the transaction rollback instruction carries a rollback mode
  • a transaction screening module configured to: if the rollback mode is a partial rollback carrying a filter condition and a transaction batch identifier, screening a target transaction that satisfies the screening condition from a transaction corresponding to the transaction batch identifier;
  • a transaction status detecting module configured to detect a transaction status of the target transaction
  • the transaction rollback module is configured to roll back the target transaction if the transaction status of the target transaction is processed.
  • a computer device comprising a memory and one or more processors having stored therein computer readable instructions, the computer readable instructions being executable by the processor to cause the one or more processors to execute The following steps:
  • the rollback mode is a partial rollback carrying a filter condition and a transaction batch identifier, screening a target transaction that satisfies the screening condition from a transaction corresponding to the transaction batch identifier;
  • the target transaction is rolled back.
  • One or more non-volatile storage media storing computer readable instructions, when executed by one or more processors, cause one or more processors to perform the following steps:
  • the rollback mode is a partial rollback carrying a filter condition and a transaction batch identifier, screening a target transaction that satisfies the screening condition from a transaction corresponding to the transaction batch identifier;
  • the target transaction is rolled back.
  • FIG. 1 is an application environment diagram of a transaction rollback method in accordance with one or more embodiments.
  • FIG. 2 is a block diagram of a computer device in accordance with one or more embodiments.
  • FIG. 3 is a flow diagram of a transaction rollback method in accordance with one or more embodiments.
  • FIG. 4 is a flow diagram of a target transaction rollback method in accordance with one or more embodiments.
  • FIG. 5 is a flow diagram of a method for rerolling a partial transaction transaction in accordance with one or more embodiments.
  • FIG. 6 is a flow diagram of a bulk transaction full rollback method in accordance with one or more embodiments.
  • FIG. 7 is a schematic flow chart of a transaction rollback method in another embodiment.
  • FIG. 8 is a block diagram of a transaction rollback device in accordance with one or more embodiments.
  • the transaction rollback method provided by the present application can be applied to an application environment as shown in FIG. 1.
  • the server 102 communicates with the terminal 104 through the network, the server 102 receives the transaction rollback instruction sent by the terminal 104, and the transaction rollback instruction carries the rollback mode; if the rollback mode is part of the rollback mode carrying the filter condition and the transaction batch identifier, then The target transaction satisfying the screening condition is selected from the transaction corresponding to the transaction batch identifier; the transaction status of the target transaction is detected; if the transaction status of the target transaction is processed, the target transaction is rolled back.
  • Server 102 can be implemented as a standalone server or as a server cluster of multiple servers.
  • Terminals 104 include, but are not limited to, various personal computers, notebook computers, smart phones, tablets, portable wearable devices, and the like. It should be noted that the transaction rollback method provided by the embodiment of the present application may also be implemented only by the server 102.
  • a computer device is provided, the internal structure of which may be as shown in FIG. 2, which may be the server shown in FIG. 1.
  • the computer device includes a processor connected by a system bus, a non-volatile storage medium, an internal memory, and a network connection port.
  • the non-volatile storage medium can be a non-transitory computer readable storage medium.
  • An operating system and computer readable instructions are stored in the non-volatile storage medium for implementing the medical service reservation method applicable to the server provided in the embodiments of the present application.
  • This processor is used to improve computing and control capabilities and support the operation of the entire server.
  • the internal memory is used to provide an environment for the operation of operating systems and computer readable instructions in a non-volatile storage medium.
  • the network interface is used for network communication with the terminal. It will be understood by those skilled in the art that the structure shown in FIG. 2 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the server to which the solution of the present application is applied. Specifically, the computer device may include More or fewer components than shown in the figure, or some components combined, or with different component arrangements.
  • a transaction rollback method is provided, which is applied to the server as shown in FIG. 2, and includes the following steps:
  • Step 302 Receive a transaction rollback instruction, and the transaction rollback instruction carries a rollback mode.
  • Transaction rollback refers to the fact that after the customer directly or indirectly conducts the product trading transaction on the Internet (such as fund trading), the data obtained after the execution of the transaction becomes meaningless due to the change of the trading parameters (such as the net value of the unit on the day of the fund buying transaction).
  • the change has caused the share of the fund purchased by the user to change, and the fund share obtained from the previous execution of the fund transaction is no longer useful, so that the data obtained after the execution of the transaction needs to be restored to the last correct state.
  • the transaction rollback instruction may be an instruction that is preset to be turned on periodically, or an instruction that the operator initiates in real time through the terminal.
  • the server initiates a preset transaction rollback instruction according to a preset open time, such as opening a transaction rollback instruction at 6 pm on the 5th and 25th of 2017, and the transaction rollback instruction carries a rollback indication
  • the data of the mode such as the filter rollback instruction carrying the filter condition and the transaction batch identifier, indicates that the rollback mode is a partial rollback in the transaction corresponding to the transaction batch identifier, and if the transaction rollback instruction only carries the transaction
  • the batch ID indicates that the rollback mode is the full rollback of the transaction corresponding to the transaction batch ID.
  • the terminal operator first inputs data indicating the rollback mode.
  • the dimension of the filter condition may be selected in the given filter condition drop-down list, and then the specific content corresponding to the filter condition dimension is input in the text box.
  • the filter form, such as the selected filter condition dimension is the transaction product, enter the transaction product name or the transaction product identifier in the text box, and input (or select) in the given batch identification input box (or selection box) to be returned.
  • the batch ID of the rolled trade and then send a trade rollback command to the server by clicking the "Send" button.
  • the rollback mode includes full rollback and partial rollback.
  • the full rollback refers to the rollback of the received batch transaction data
  • the batch transaction data may be the transaction data identified by the batch application date.
  • the transaction application date may be a specific date (such as July 2, 2017) or a certain time range (such as June 2, 2017 to July 2, 2017).
  • Step 304 If the rollback mode is a partial rollback carrying the filter condition and the transaction batch identifier, the target transaction satisfying the screening condition is selected from the transaction corresponding to the transaction batch identifier.
  • the screening criteria are based on actual trading needs.
  • the screening conditions include at least one of two dimensions of a transaction product and a transaction user.
  • the performance form of the transaction product may be a transaction product name, a transaction product type, or a transaction product identifier (such as a product code);
  • the transaction user may be in the form of a transaction product holding user name or a transaction product. Hold the user ID (such as the user ID number).
  • the screening conditions are not limited to the screening conditions of the two dimensions of the transaction product and the transaction user listed in the embodiment. In the embodiment, the screening conditions of other dimensions may also be determined according to actual transaction requirements.
  • the transaction batch identifier is used to uniquely identify the received batch transaction, specifically, the transaction application date, such as batch 20170405, or a deformation based on the transaction application date, such as batches 20170405001 and 20170405002, Is the transaction batch ID generated by the custom rule, such as batch S342209A.
  • the number of received transaction batch identifiers is not limited, and may be one or multiple.
  • the target transaction is filtered based on the filter criteria and the transaction batch ID in the transaction stored by the server.
  • the transactions stored by the server are obtained from a sales platform such as a bank.
  • the screening condition is that the fund product identifier is 004282, the transaction batch identifier is 20160504, and the target transaction is in the fund transaction conducted on the day of May 4, 2016, the user purchases or redeems the fund transaction with the fund product identifier 004282.
  • the screening condition is that the fund transaction holding user ID is 342401196802058475, the transaction batch identifier is 20160504, 20160505, 20160506, and the target transaction is the user ID 342401196802058475 corresponding user from May 4, 2016 to May 6, 2016 Fund transactions conducted in three days.
  • Step 306 detecting the transaction status of the target transaction.
  • the transaction status includes three states: pending, in process, and processed. Specifically, after the server receives the transaction data that is uploaded by the terminal and carries the transaction batch identifier, the transaction data is stored in the database and marked as a pending state; the server periodically detects whether there is a transaction in the database to be processed, if any , the transaction status of the transaction is changed to the processing status, and the transaction is executed according to the preset transaction execution rule; when the transaction is successfully executed, such as a fund purchase transaction, the server successfully writes the fund share of the fund transaction. Entering the database and sending it to the user terminal will change the processing status of the transaction to the processed status.
  • Step 308 If the transaction status of the target transaction is processed, the target transaction is rolled back.
  • the transaction status of the target transaction is processed, it indicates that the target transaction has been processed in the batch transaction being executed, and the target transaction can be rolled back, and has no effect on the non-target transaction in the batch transaction still in the execution state; Or if the batch transaction of the batch in the target transaction has been processed, the target transaction can be rolled back.
  • the target transaction needs to be re-executed according to the changed value of the transaction execution parameter, so that the server sends the data obtained after the target transaction is re-executed to the terminal. For example, on March 7, 2017, the customer spent 2,000 yuan to purchase a fund.
  • the server obtained the unit net value of the fund on March 7, 2017, which was 1 yuan/share, and told the customer to purchase 2000 funds.
  • 2017 On March 8th the fund's unit net value is 1.5 yuan / share, so the server needs to do transaction rollback, the customer's account assets on March 8, 2017 will be converted into the total assets of the account on March 6, 2017, which is Empty, and then re-read the unit's net worth data on March 8, 2017, to calculate the customer's 3,000 yuan assets.
  • the step of rolling back the target transaction includes:
  • step 318 the data written in the database during the execution of the target transaction is changed to the data before the execution of the target transaction.
  • the execution flow of the transaction is pre-set, and the data written to the database during the execution of the transaction is determined.
  • the execution process of each fund transaction is: reading the fund transaction type. If the fund transaction type is purchase, the fund transaction amount is read, and the unit net value of the fund transaction application date provided by the fund net value interface is obtained, according to the fund transaction amount. Calculate the user's share with the unit net value, calculate the user's current share of the current account based on the calculated user share and the pre-stored user share share, and obtain the current unit net value of the fund, based on the current user share and the current unit net value.
  • the current unit net value is calculated based on the current unit net value of the fund and the pre-stored user history share. Therefore, the data written into the database during the execution of the fund transaction is the user holding share or the user redemption amount. Then, for the rollback of the target transaction, the value corresponding to the user's share of the target transaction (the fund transaction type is purchased) or the user redemption amount (the fund transaction type is redemption) corresponding to the target transaction during the execution process is required. The value is modified to execute the null value before the transaction, and the current net asset value is changed to the historical net asset value before the transaction is executed.
  • Step 328 modifying the transaction status of the target transaction to a pending status.
  • the transaction status is changed to the "processed” status. Then, for the rollback of the target transaction, the transaction status needs to be changed to the "pending" status.
  • the rollback of the target transaction is realized by the program code, instead of the rollback of the target transaction through the database.
  • the error location can be located in real time, so that the problem can be solved in time to re-roll the data, and the transaction processing is guaranteed. Timeliness.
  • the method further includes:
  • Step 502 If the rollback mode is a partial rollback carrying the transaction data, parsing the transaction data to obtain the transaction product identifier, the transaction application date, and the transaction product holding user identifier.
  • Transaction data is data generated by a user directly or indirectly through a trading operation on the Internet.
  • fund transaction data includes: fund holding user identification, fund transaction type, fund identification, fund transaction application date, transaction amount or user holding share.
  • Step 504 If the transaction product identifier is consistent with the preset supplemental transaction product identifier, and the transaction application date is earlier than the current date, the transaction product identifier and the transaction product holding user identifier stored in the search database are the same and the transaction application date is the same. A transaction to be rolled back later than the transaction application date.
  • the transaction product identifier is consistent with the preset replenishment transaction product identifier, it indicates that the transaction product is a transaction product that can perform transaction data re-recording operation. And when the transaction application date is earlier than the current date of the system, the current transaction data of the transaction product is to be re-recorded. Then, after the transaction data of the transaction product is added to the system, all the transaction data after the date of the application for the replacement transaction needs to be rolled back before the execution of the transaction data.
  • the system does not perform bulk trading every day, but does the transaction re-recording afterwards.
  • the transaction application date as the transaction batch identifier as an example, the following description is made: when the transaction with the transaction batch identifier of 20170605 is entered first, and the transaction batch identifier is entered after the transaction of 20170302, the transaction with the transaction batch identifier of 20170302 is executed. Before the transaction data is rolled back, the transaction data identified as the transaction batch of 20170605 is first restored to the state of the transaction batch identifier of 20170301.
  • step 506 the transaction to be rolled back is rolled back.
  • the single-thread execution mode is adopted. Therefore, before the transaction to be rolled back is performed, the transaction data to be rolled back is directly rolled back after the transaction is confirmed to be rolled back: The data value written into the database during the execution of the roll transaction is changed to the data value before the execution of the transaction to be rolled back, and the transaction state of the transaction to be rolled back is modified to the pending state.
  • the method further includes:
  • Step 602 If the rollback mode is a full rollback carrying the transaction batch identifier, the transaction corresponding to the transaction batch identifier is obtained.
  • the transaction batch identifier is used to uniquely identify the received batch transaction, specifically, the transaction application date, or the deformation of the transaction request date as a base string, or a transaction batch generated by a custom rule. logo, etc.
  • the number of received transaction batch identifiers is not limited, and may be one or multiple.
  • Step 604 detecting the transaction status of the transaction corresponding to the transaction batch identifier.
  • the multi-thread parallel execution mode is used to process the transaction data. Therefore, after acquiring the transaction corresponding to the transaction batch identifier, it is also necessary to detect the transaction status of the transaction.
  • the transaction status includes three states: pending, in process, and processed.
  • Step 606 If the transaction status of the transaction corresponding to the transaction batch identifier is processed, the transaction corresponding to the transaction batch identifier is rolled back.
  • the batch transaction corresponding to the received transaction batch identifier is rolled back: corresponding to the transaction batch identifier
  • the data written in the database during the execution of the transaction is changed to execute the data before the transaction corresponding to the transaction batch identifier; the transaction status corresponding to the transaction batch identifier is modified to the pending state.
  • a rollback method for partially rolling back a transaction product with a large transaction volume but also a rollback method for performing full rollback of the received batch transaction data is provided, so that the system can perform different manners.
  • the rollback improves the flexibility of transaction rollback.
  • another transaction rollback method including:
  • Step 702 Receive a transaction rollback instruction, and the transaction rollback instruction carries a rollback mode.
  • the transaction rollback instruction may be an instruction that is preset to be turned on periodically, or an instruction that the operator initiates in real time through the terminal; the rollback mode includes full rollback and partial rollback.
  • Step 704 If the rollback mode is a partial rollback carrying the filter condition and the transaction batch identifier, the target transaction satisfying the screening condition is selected from the transaction corresponding to the transaction batch identifier.
  • the screening criteria are based on actual trading needs.
  • the screening conditions include at least one of two dimensions of a transaction product and a transaction user.
  • the performance form of the transaction product may be a transaction product name, a transaction product type, or a transaction product identifier;
  • the transaction user may be in the form of a transaction product holding user name, or may be a transaction product holding user identifier, etc.
  • the screening conditions are not limited to the screening conditions of the two dimensions of the transaction product and the transaction user listed in the embodiment. In one embodiment, the screening conditions of other dimensions may also be determined according to actual transaction requirements.
  • the transaction batch ID is used to uniquely identify the bulk transaction received.
  • the number of the received transaction batch identifiers is not limited, and may be one or multiple.
  • Step 706 detecting the transaction status of the target transaction.
  • the multi-thread parallel execution mode is used to process the transaction data. Therefore, after finding the target transaction satisfying the screening condition in the received batch transaction, it is necessary to detect the transaction status of the target transaction, and correspondingly according to the transaction status.
  • Step 708 If the transaction status of the target transaction is processed, the target transaction is rolled back.
  • the transaction status includes three states: pending, in process, and processed. Rollback is only possible after the execution of the target transaction has ended.
  • Step 710 If the rollback mode is a partial rollback carrying the transaction data, parsing the transaction data to obtain the transaction product identifier, the transaction application date, and the transaction product holding user identifier.
  • Transaction data is data generated by a user directly or indirectly through a trading operation on the Internet.
  • fund transaction data includes: fund holding user identification, fund transaction type, fund identification, fund transaction application date, transaction amount or user holding share.
  • Step 712 If the transaction product identifier is consistent with the preset supplemental transaction product identifier, and the transaction application date is earlier than the current date, the transaction product identifier and the transaction product holding user identifier stored in the search database are the same and the transaction application date is the same. A transaction to be rolled back later than the transaction application date.
  • the transaction product is a transaction product that can perform the transaction data re-recording operation, and when the transaction application date is earlier than the current date of the system, the current transaction product is to be executed. A supplement to the transaction data. Then, after the transaction data of the transaction product is added to the system, all the transaction data after the date of the application for the replacement transaction needs to be rolled back before the execution of the transaction data.
  • step 714 the transaction to be rolled back is rolled back.
  • the single-thread execution mode is adopted. Therefore, before the transaction of the re-rolling is performed, the transaction data to be rolled back needs to be directly rolled back after the transaction to be rolled back is determined.
  • Step 716 If the rollback mode is a full rollback carrying the transaction batch identifier, the transaction corresponding to the transaction batch identifier is obtained.
  • Step 718 detecting the transaction status of the transaction corresponding to the transaction batch identifier.
  • the transaction data is processed by the multi-thread parallel execution mode. Therefore, after acquiring the transaction corresponding to the transaction batch identifier, it is also necessary to detect the transaction status of the transaction.
  • Step 720 If the transaction status of the transaction corresponding to the transaction batch identifier is processed, the transaction corresponding to the transaction batch identifier is rolled back.
  • the transaction After obtaining the transaction corresponding to the received transaction batch identifier and determining that the transaction status of the transaction corresponding to the transaction identifier is processed, the transaction is fully rolled back.
  • a rollback method for partially rolling back a transaction product with a large transaction volume is provided, but also a rollback method for partially rolling back a transaction product with a small transaction volume due to the double-registration transaction, and
  • the rollback method of the full volume rollback of the received batch transaction data enables the system to roll back different ways according to the transaction volume of the transaction product, thereby improving the flexibility of the transaction rollback.
  • FIGS. 3-7 are sequentially displayed as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Except as explicitly stated herein, the execution of these steps is not strictly limited, and the steps may be performed in other orders. Moreover, at least some of the steps in FIGS. 3-7 may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, these sub-steps or stages The order of execution is not necessarily performed sequentially, but may be performed alternately or alternately with at least a portion of other steps or sub-steps or stages of other steps.
  • a transaction rollback device including a transaction rollback instruction receiving module 802, a transaction screening module 804, a transaction status detection module 806, and a transaction rollback module 808, wherein:
  • the transaction rollback instruction receiving module 802 is configured to receive a transaction rollback instruction, and the transaction rollback instruction carries a rollback mode.
  • the transaction screening module 804 is configured to: if the rollback mode is a part of the rollback carrying the filter condition and the transaction batch identifier, filter the target transaction that meets the screening condition from the transaction corresponding to the transaction batch identifier.
  • the transaction status detection module 806 is configured to detect a transaction status of the target transaction.
  • the transaction rollback module 808 is configured to roll back the target transaction if the transaction status of the target transaction is processed.
  • the screening condition includes at least one of a transaction product and a transaction product holding user.
  • the transaction rollback module 808 is configured to change the data written to the database during the execution of the target transaction to the data before the execution of the target transaction; and modify the transaction status of the target transaction to the pending state.
  • the transaction rollback module 808 is further configured to: if the rollback mode is a partial rollback carrying the transaction data, parsing the transaction data to obtain the transaction product identifier, the transaction application date, and the transaction product holding user identifier;
  • the product identification is consistent with the preset replenishment transaction product identification, and the transaction application date is earlier than the current date, the search product identifier and the transaction product holding user ID stored in the search database are the same and the transaction application date is later than the transaction application date.
  • the transaction to be rolled back; the transaction to be rolled back is rolled back.
  • the transaction rollback module 808 is further configured to: if the rollback mode is a full rollback carrying the transaction batch identifier, obtain a transaction corresponding to the transaction batch identifier; and detect a transaction corresponding to the transaction batch identifier The transaction status, if the transaction status of the transaction corresponding to the transaction batch identifier is processed, the transaction corresponding to the transaction batch identifier is rolled back.
  • Each of the above-described transaction rollback devices may be implemented in whole or in part by software, hardware, and combinations thereof.
  • Each of the above modules may be embedded in or independent of the processor in the computer device, or may be stored in a memory in the computer device in a software form, so that the processor invokes the operations corresponding to the above modules.
  • a computer device comprising a memory and one or more processors having stored therein computer readable instructions, the computer readable instructions being executed by the processor such that the one or more processors perform the following steps:
  • the target transaction satisfying the screening condition is selected from the transaction corresponding to the transaction batch identifier
  • the target transaction is rolled back.
  • the screening condition includes at least one of a transaction product and a transaction user.
  • the step of the processor performing the rollback of the target transaction includes: changing data written in the database during the execution of the target transaction to data before executing the target transaction; and transacting the target transaction The status is changed to the pending status.
  • the processor when executing the computer readable instructions, further implements the step of parsing the transaction data to obtain the transaction product identification, the transaction application date, and the transaction product holding if the rollback mode is a partial rollback carrying the transaction data.
  • the processor when executing the computer readable instructions, further implements the step of: obtaining a transaction corresponding to the transaction batch identifier if the rollback mode is a full volume rollback carrying the transaction batch identifier; and detecting and trading The transaction status of the transaction corresponding to the batch identifier. If the transaction status of the transaction corresponding to the transaction batch identifier is processed, the transaction corresponding to the transaction batch identifier is rolled back.
  • One or more non-volatile storage media storing computer readable instructions, when executed by one or more processors, cause one or more processors to perform the following steps:
  • the target transaction satisfying the screening condition is selected from the transaction corresponding to the transaction batch identifier
  • the target transaction is rolled back.
  • the screening condition includes at least one of a transaction product and a transaction user.
  • the computer readable instructions are further executed by the processor to: change the data written to the database during the execution of the target transaction to data prior to execution of the target transaction; and modify the transaction status of the target transaction Is pending status.
  • the computer readable instructions are further executed by the processor to: if the rollback mode is a partial rollback carrying the transaction data, parsing the transaction data to obtain the transaction product identification, the transaction application date, and the transaction product holding There is a user identifier; if the transaction product identifier is consistent with the preset replenishment transaction product identifier, and the transaction application date is earlier than the current date, the search product identifier and the transaction product holder user identifier stored in the search database are the same and the transaction application is The transaction to be rolled back later than the transaction application date; and the rollback transaction to be rolled back.
  • the computer readable instructions are further executed by the processor to: if the rollback mode is a full rollback carrying the batch identification, obtaining a transaction corresponding to the batch identification; and detecting and trading batches The transaction status of the transaction corresponding to the secondary identification, if the transaction status of the transaction corresponding to the transaction batch identifier is processed, the transaction corresponding to the transaction batch identifier is rolled back.
  • Non-volatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM is available in a variety of formats, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronization chain.
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • Synchlink DRAM SLDRAM
  • Memory Bus Radbus
  • RDRAM Direct RAM
  • DRAM Direct Memory Bus Dynamic RAM
  • RDRAM Memory Bus Dynamic RAM

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • General Physics & Mathematics (AREA)
  • Development Economics (AREA)
  • Technology Law (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Quality & Reliability (AREA)
  • General Engineering & Computer Science (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

一种交易回滚方法,包括:接收交易回滚指令,交易回滚指令携带回滚模式;若回滚模式为携带筛选条件和交易批次标识的部分回滚,则从与交易批次标识对应的交易中筛选出满足筛选条件的目标交易;检测目标交易的交易状态;及若目标交易的交易状态为已处理,则将目标交易进行回滚。

Description

交易回滚方法、装置、计算机设备和存储介质
本申请要求于2017年07月31日提交中国专利局,申请号为2017106438738,申请名称为“交易回滚方法、装置、存储介质和计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及一种交易回滚方法、装置、计算机设备和存储介质。
背景技术
交易回滚是指客户直接或间接在互联网上进行产品买卖交易后(如基金交易),因交易参数的变更等使得交易执行后得到的数据变得没有意义(如基金交易的当日单位净值发生变化使得用户购买的基金份额发生了变化,原先执行基金交易得到的基金份额不再有用),从而需要将交易执行后得到的数据恢复到上一次正确的状态。
传统的交易回滚方法是将接收到的批量交易全部执行后,对批量交易进行全量回滚。然而,发明人意识到,当批量交易的数量较大时,交易全量回滚耗费时间长,使得交易回滚效率低。
发明内容
根据本申请公开的各种实施例,提供一种交易回滚方法、装置、计算机设备和存储介质。
一种交易回滚方法,包括:
接收交易回滚指令,所述交易回滚指令携带回滚模式;
若所述回滚模式为携带筛选条件和交易批次标识的部分回滚,则从与所述交易批次标识对应的交易中筛选出满足所述筛选条件的目标交易;
检测所述目标交易的交易状态;及
若所述目标交易的交易状态为已处理,则将所述目标交易进行回滚。
一种交易回滚装置,包括:
交易回滚指令接收模块,用于接收交易回滚指令,所述交易回滚指令携带回滚模式;
交易筛选模块,用于若所述回滚模式为携带筛选条件和交易批次标识的部分回滚,则从与所述交易批次标识对应的交易中筛选出满足所述筛选条件的目标交易;
交易状态检测模块,用于检测所述目标交易的交易状态;及
交易回滚模块,用于若所述目标交易的交易状态为已处理,则将所述目标交易进行回滚。
一种计算机设备,包括存储器和一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述一个或多个处理器执行以下步骤:
接收交易回滚指令,所述交易回滚指令携带回滚模式;
若所述回滚模式为携带筛选条件和交易批次标识的部分回滚,则从与所述交易批次标识对应的交易中筛选出满足所述筛选条件的目标交易;
检测所述目标交易的交易状态;及
若所述目标交易的交易状态为已处理,则将所述目标交易进行回滚。
一个或多个存储有计算机可读指令的非易失性存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:
接收交易回滚指令,所述交易回滚指令携带回滚模式;
若所述回滚模式为携带筛选条件和交易批次标识的部分回滚,则从与所述交易批次标识对应的交易中筛选出满足所述筛选条件的目标交易;
检测所述目标交易的交易状态;及
若所述目标交易的交易状态为已处理,则将所述目标交易进行回滚。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为根据一个或多个实施例中交易回滚方法的应用环境图。
图2为根据一个或多个实施例中计算机设备的框图。
图3为根据一个或多个实施例中交易回滚方法的流程示意图。
图4为根据一个或多个实施例中目标交易回滚方法的流程示意图。
图5为根据一个或多个实施例中补录交易部分回滚方法的流程示意图。
图6为根据一个或多个实施例中批量交易全量回滚方法的流程示意图。
图7为另一个实施例中交易回滚方法的流程示意图。
图8为根据一个或多个实施例中交易回滚装置的框图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请提供的交易回滚方法,可应用于如图1所示的应用环境中。服务器102通过网络与终端104进行通信,服务器102接收终端104发送的交易回滚指令,交易回滚指令携带回滚模式;若回滚模式为携带筛选条件和交易批次标识的部分回滚,则从与交易批次标识对应的交易中筛选出满足筛选条件的目标交易;检测目标交易的交易状态;若目标交易的交易状态为已处理,则将目标交易进行回滚。服务器102可以用独立的服务器或者是多个服务器组成的服务器集群来实现。终端104包括但不限于各种个人计算机、笔记本电脑、智能手机、平板电脑、便携式穿戴设备等。应当说明的是,本申请实施例提供的交易回滚方法还可仅通过服务器102实现。
在其中一个实施例中,提供了一种计算机设备,其内部结构图可以如图2 所示,该计算机设备可以是图1中所示的服务器。该计算机设备包括通过系统总线连接的处理器、非易失性存储介质、内存储器、网络连接口。非易失性存储介质可以是非易失性计算机可读存储介质。非易失性存储介质中存储有操作系统和计算机可读指令,该计算机可读指令用于实现本申请实施例中提供的适用于服务器的医疗服务预约方法。该处理器用于提高计算和控制能力,支撑整个服务器的运行。内存储器用于为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。网络接口用于与终端进行网络通信。本领域技术人员可以理解,图2中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的服务器的限定,具体地计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在其中一个实施例中,如图3所示,提供了一种交易回滚方法,该方法以应用于如图2中的服务器进行说明,包括以下步骤:
步骤302,接收交易回滚指令,交易回滚指令携带回滚模式。
交易回滚是指客户直接或间接在互联网上进行产品买卖交易后(如基金交易),因交易参数的变更等使得交易执行后得到的数据变得没有意义(如基金买入交易的当日单位净值发生变化,使得用户购买的基金份额发生了变化,原先执行基金交易得到的基金份额不再有用),从而需要将交易执行后得到的数据恢复到上一次正确的状态。交易回滚指令可以是预先设置定时开启的指令,也可以是操作人员通过终端实时发起的指令。
在其中一个实施例中,服务器根据预设开启时间启动预设的交易回滚指令,如2017年的5与25日下午6点开启交易回滚指令,该交易回滚指令中携带了表明回滚模式的数据,如交易回滚指令中携带了筛选条件和交易批次标识,则表明回滚模式为与交易批次标识对应的交易中的部分回滚,若交易回滚指令中仅携带了交易批次标识,则表明回滚模式为与交易批次标识对应的交易的全量回滚。在其他实施例中,终端操作人员先输入表明回滚模式的数据,具体地,可在给出的筛选条件下拉列表中选择筛选条件的维度,再在文本框中输入对应于筛选条件维度的具体筛选形式,如选择的筛选条件维度是交易产品,在文本 框中输入交易产品名称或交易产品标识,在给出的批次标识输入框(或选择框中)输入(或选择出)要进行回滚的交易所在的批次标识,再通过点击“发送”按钮向服务器发送交易回滚指令。
回滚模式包括全量回滚和部分回滚。全量回滚是指将接收到的批量交易数据进行回滚,批量交易数据可以是以交易申请日期为批次标识的交易数据。具体的,交易申请日期可以是某一具体日期(如2017年7月2日)或某一时间范围(如2017年6月2日至2017年7月2日)。
步骤304,若回滚模式为携带筛选条件和交易批次标识的部分回滚,则从与交易批次标识对应的交易中筛选出满足筛选条件的目标交易。
筛选条件是根据实际的交易需求制定出来的。筛选条件包括交易产品和交易用户两个维度中的至少一种。具体地,交易产品的表现形式可以是交易产品名称,交易产品类型,也可以是交易产品标识(如产品编码)等;交易用户的表现形式可以是交易产品持有用户名称,也可以是交易产品持有用户标识(如用户身份证号)等。应当说明的是,筛选条件不局限于本实施例列举出来的交易产品和交易用户两个维度的筛选条件,在其实施例中,还可根据实际交易需求制定出其他维度的筛选条件。
交易批次标识用于唯一标识接收到的批量交易,具体地,可以是交易申请日期,如批次20170405,或是以交易申请日期为基底字符串的变形,如批次20170405001和20170405002,也可以是自定义规则生成的交易批次标识,如批次S342209A等。此外,对于接收到交易批次标识的数量不做限定,可以是一个,也可以是多个。
目标交易是根据筛选条件和交易批次标识在服务器存储的交易中筛选出来的。服务器存储的交易是从银行等销售平台获取的。例如,筛选条件是基金产品标识为004282,交易批次标识为20160504,则目标交易是在2016年5月4日这一天进行的基金交易中,用户购买或赎回基金产品标识为004282的基金交易;或者筛选条件是基金交易持有用户标识为342401196802058475,交易批次标识为20160504,20160505,20160506,则目标交易为用户标识为342401196802058475对应的用户在2016年5月4日至2016年5月6日三天进 行的基金交易。
步骤306,检测目标交易的交易状态。
对于交易量大的交易产品,采用多线程并行执行模式处理交易数据,因此在筛选出目标交易后,还需要检测目标交易的交易状态。交易状态包括待处理、处理中和已处理三种状态。具体地,当服务器接收终端上传的携带交易批次标识的交易数据后,将该交易数据存储到数据库中,并标记为待处理状态;服务器再定时检测数据库中是否有待处理状态的交易,若有,则将该交易的处理状态变更为处理中状态,并按照预设交易执行规则执行该交易;当该交易成功执行完毕,如一笔基金购买交易中,服务器成功将该笔基金交易的基金份额写入数据库,并发送给用户终端,将则将该交易的处理状态变更为已处理状态。
在接收到的批量交易中找出满足筛选条件的目标交易后,需要检测目标交易的交易状态,根据交易状态进行对应的后续操作。
步骤308,若目标交易的交易状态为已处理,则将目标交易进行回滚。
若目标交易的交易状态为已处理,则说明正在执行的批量交易中,目标交易已经处理完毕,则可对目标交易进行回滚,对于仍然处于执行状态的批量交易中的非目标交易没有影响;或者目标交易所在批次的批量交易都已处理完毕,则可以将目标交易进行回滚。此外,目标交易回滚成功后,需要根据交易执行参数的变更值重新执行目标交易,以使服务器将目标交易重新执行后得到的数据发送给终端。比如客户于2017年3月7日花了2000元购买了一种基金,服务器获取到2017年3月7日该基金的单位净值为1元/份,告知客户购买了2000份该基金,2017年3月8日该基金的单位净值是1.5元/份,因此需要服务器做交易回滚,把客户在2017年3月8日的账户资产变成2017年3月6日的账户总资产,即为空,再重新读取该基金2017年3月8日的单位净值数据,从而计算客户拥有3000元资产。
上述交易回滚方法中,批量交易正在被执行或执行完毕后,发现接收到的批量交易中部分交易的参数发生变更,只需要对该部分交易进行回滚,相比于将该部分交易所在批次的所有交易进行全量回滚,提高了交易回滚效率。
在其中一个实施例中,如图4所示,将目标交易进行回滚的步骤包括:
步骤318,将目标交易在执行过程中写入数据库的数据变更为执行目标交易前的数据。
交易的执行流程是预先设定好的,对于交易在执行过程中写入数据库的数据是确定的。例如,每一笔基金交易的执行流程是:读取基金交易类型,若基金交易类型是购买,则读取基金交易金额,获取基金净值接口提供的基金交易申请日期的单位净值,根据基金交易金额和单位净值计算用户持有份额,根据计算得到的用户持有份额和预存的用户历史持有份额计算用户当期持有份额,获取基金的当前单位净值,根据当前用户持有份额和当前单位净值计算当前资产净值;若基金交易类型是赎回,则读取用户持有份额,获取基金净值接口提供的基金交易申请日期的单位净值,根据用户持有份额和单位净值计算用户赎回金额,获取基金的当前单位净值,根据基金的当前单位净值、预存的用户历史持有份额计算当前资产净值。因此,基金交易在执行过程写入数据库的数据就是用户持有份额或用户赎回金额。那么,对于目标交易的回滚,需要将目标交易在执行过程中写入数据库的用户持有份额(基金交易类型是购买)对应的数值或用户赎回金额(基金交易类型是赎回)对应的数值修改为执行交易前的空值,当前资产净值变更为交易执行前的历史资产净值。
步骤328,将目标交易的交易状态修改为待处理状态。
目标交易执行过后,会将交易状态变更为“已处理”状态。那么,对于目标交易的回滚,需要将交易状态修改为“待处理”状态。
通过程序代码实现目标交易的回滚,而非通过数据库进行目标交易的回滚,当目标交易的回滚出现问题,可实时定位出错位置,以便及时解决问题重新进行数据回滚,保证了交易处理的时效性。
在其中一个实施例中,如图5所示,步骤308之后,还包括:
步骤502,若回滚模式为携带交易数据的部分回滚,则解析交易数据得到交易产品标识、交易申请日期和交易产品持有用户标识。
交易数据是用户直接或间接通过互联网进行买卖交易操作生成的数据。例如,基金交易数据包括:基金持有用户标识、基金交易类型、基金标识、基金交易申请日期、交易金额或用户持有份额等。
步骤504,若交易产品标识与预设补录交易产品标识对比一致,且交易申请日期早于当前日期,则查找数据库中存储的与交易产品标识和交易产品持有用户标识均相同且交易申请日期晚于交易申请日期的待回滚交易。
若交易产品标识与预设补录交易产品标识对比一致,说明此交易产品是可进行交易数据补录操作的交易产品。且当交易申请日期早于系统当前日期时,说明当前要进行该交易产品的交易数据的补录。那么,在将该交易产品的交易数据补录至系统后,在执行该补录交易数据前,需要对补录交易申请日期后的所有交易数据进行回滚。
例如,针对一些交易量小的基金产品,系统不是每天都执行批量交易,而是事后进行交易补录。以交易申请日期作为交易批次标识为例进行如下说明:当出现交易批次标识为20170605的交易先录入,交易批次标识为20170302的交易后录入时,在执行交易批次标识为20170302的交易前要先进行交易数据回滚,即先把交易批次标识为20170605的交易数据还原到交易批次标识为20170301的状态。
步骤506,将待回滚交易进行回滚。
对于交易量较小的交易数据的处理采用单线程执行模式,因此,在执行补录交易前,需要在确定了待回滚的交易后,直接将待回滚交易数据进行回滚:将待回滚交易在执行过程中写入数据库的数据值变更为执行待回滚交易前的数据值,将待回滚交易的交易状态修改为待处理状态。
本实施例中,不仅提供了对于交易量庞大的交易产品进行部分回滚的回滚方法,还提供了对于交易量小的交易产品因补录交易而进行部分回滚的回滚方法,使得系统能够根据交易产品的交易量大小进行不同方式的回滚,提高了交易回滚的灵活性。
在其中一个实施例中,如图6所示,在步骤308之后,还包括:
步骤602,若回滚模式为携带交易批次标识的全量回滚,则获取与交易批次标识对应的交易。
同样地,交易批次标识用于唯一标识接收到的批量交易,具体地,可以是交易申请日期,或是以交易申请日期为基底字符串的变形,也可以是自定义规 则生成的交易批次标识等。此外,对于接收到交易批次标识的数量不做限定,可以是一个,也可以是多个。
步骤604,检测与交易批次标识对应的交易的交易状态。
同样地,对于交易量大的交易产品,采用多线程并行执行模式处理交易数据,因此,在获取与交易批次标识对应的交易后,还需要检测该交易的交易状态。交易状态包括待处理、处理中和已处理三种状态。
步骤606,若与交易批次标识对应的交易的交易状态为已处理,则将与交易批次标识对应的交易进行回滚。
当只接收到交易批次标识且确定该交易标识对应的交易的交易状态为已处理时,则将与接收到的交易批次标识对应的批次交易进行回滚:将与交易批次标识对应的交易在执行过程中写入数据库的数据变更为执行与交易批次标识对应的交易前的数据;将与交易批次标识对应的交易状态修改为待处理状态。
本实施例中,不仅提供了对于交易量庞大的交易产品可进行部分回滚的回滚方法,还提供了对于接收到的批量交易数据进行全量回滚的回滚方法,使得系统能够进行不同方式的回滚,提高了交易回滚的灵活性。
在其中一个实施例中,如图7所示,提供了另一种交易回滚方法,包括:
步骤702,接收交易回滚指令,交易回滚指令携带回滚模式。
同样地,交易回滚指令可以是预先设置定时开启的指令,也可以是操作人员通过终端实时发起的指令;回滚模式包括全量回滚和部分回滚。
步骤704,若回滚模式为携带筛选条件和交易批次标识的部分回滚,则从与交易批次标识对应的交易中筛选出满足筛选条件的目标交易。
筛选条件是根据实际的交易需求制定出来的。筛选条件包括交易产品和交易用户两个维度中的至少一种。具体地,交易产品的表现形式可以是交易产品名称,交易产品类型,也可以是交易产品标识等;交易用户的表现形式可以是交易产品持有用户名称,也可以是交易产品持有用户标识等。应当说明的是,筛选条件不局限于本实施例列举出来的交易产品和交易用户两个维度的筛选条件,在其中一个实施例中,还可根据实际交易需求制定出其他维度的筛选条件。
交易批次标识用于唯一标识接收到的批量交易。本实施例中,对于接收到 交易批次标识的数量不做限定,可以是一个,也可以是多个。
步骤706,检测目标交易的交易状态。
对于交易量大的交易产品,采用多线程并行执行模式处理交易数据,因此在接收到的批量交易中找出满足筛选条件的目标交易后,需要检测目标交易的交易状态,根据交易状态进行对应的后续操作。
步骤708,若目标交易的交易状态为已处理,则将目标交易进行回滚。
交易状态包括待处理、处理中和已处理三个状态。只有目标交易执行结束后,才可进行回滚。
步骤710,若回滚模式为携带交易数据的部分回滚,则解析交易数据得到交易产品标识、交易申请日期和交易产品持有用户标识。
交易数据是用户直接或间接通过互联网进行买卖交易操作生成的数据。例如,基金交易数据包括:基金持有用户标识、基金交易类型、基金标识、基金交易申请日期、交易金额或用户持有份额等。
步骤712,若交易产品标识与预设补录交易产品标识对比一致,且交易申请日期早于当前日期,则查找数据库中存储的与交易产品标识和交易产品持有用户标识均相同且交易申请日期晚于交易申请日期的待回滚交易。
若交易产品标识与预设补录交易产品标识对比一致,说明此交易产品是可进行交易数据补录操作的交易产品,且当交易申请日期早于系统当前日期时,说明当前要进行该交易产品的交易数据的补录。那么,在将该交易产品的交易数据补录至系统后,在执行该补录交易数据前,需要对补录交易申请日期后的所有交易数据进行回滚。
步骤714,将待回滚交易进行回滚。
对于交易量较小的交易数据的处理采用单线程执行模式,因此,在执行补录交易前,需要在确定了待回滚的交易后,直接将待回滚交易数据进行回滚。
步骤716,若回滚模式为携带交易批次标识的全量回滚,则获取与交易批次标识对应的交易。
当只接收到交易批次标识时,说明当前需要对交易批次标识对应的交易进行全量回滚。
步骤718,检测与交易批次标识对应的交易的交易状态。
对于交易量大的交易产品,采用多线程并行执行模式处理交易数据,因此,在获取与交易批次标识对应的交易后,还需要检测该交易的交易状态。
步骤720,若与交易批次标识对应的交易的交易状态为已处理,则将与交易批次标识对应的交易进行回滚。
在获取了与接收到的交易批次标识对应的交易后且确定该交易标识对应的交易的交易状态为已处理,将该交易进行全量回滚。
本实施例中,不仅提供了对于交易量庞大的交易产品进行部分回滚的回滚方法,还提供了对于交易量小的交易产品因补录交易而进行部分回滚的回滚方法,以及对于接收到的批量交易数据进行全量回滚的回滚方法,使得系统能够根据交易产品的交易量大小进行不同方式的回滚,提高了交易回滚的灵活性。
应该理解的是,虽然图3-7的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图3-7中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
在其中一个实施例中,如图8所示,提供了一种交易回滚装置,包括交易回滚指令接收模块802、交易筛选模块804、交易状态检测模块806和交易回滚模块808,其中:
交易回滚指令接收模块802,用于接收交易回滚指令,交易回滚指令携带回滚模式。
交易筛选模块804,用于若回滚模式为携带筛选条件和交易批次标识的部分回滚,则从与交易批次标识对应的交易中筛选出满足筛选条件的目标交易。
交易状态检测模块806,用于检测目标交易的交易状态。
交易回滚模块808,用于若目标交易的交易状态为已处理,则将目标交易进行回滚。
在其中一个实施例中,筛选条件包括交易产品和交易产品持有用户中的至少一种。
在其中一个实施例中,交易回滚模块808用于将目标交易在执行过程中写入数据库的数据变更为执行目标交易前的数据;将目标交易的交易状态修改为待处理状态。
在其中一个实施例中,交易回滚模块808还用于若回滚模式为携带交易数据的部分回滚,则解析交易数据得到交易产品标识、交易申请日期和交易产品持有用户标识;若交易产品标识与预设补录交易产品标识对比一致,且交易申请日期早于当前日期,则查找数据库中存储的与交易产品标识和交易产品持有用户标识均相同且交易申请日期晚于交易申请日期的待回滚交易;将待回滚交易进行回滚。
在其中一个实施例中,交易回滚模块808还用于若回滚模式为携带交易批次标识的全量回滚,则获取与交易批次标识对应的交易;检测与交易批次标识对应的交易的交易状态,若与交易批次标识对应的交易的交易状态为已处理,则将与交易批次标识对应的交易进行回滚。
关于交易回滚装置的具体限定可以参见上文中对于交易回滚方法的限定,在此不再赘述。上述交易回滚装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
一种计算机设备,包括存储器和一个或多个处理器,存储器中储存有计算机可读指令,计算机可读指令被处理器执行时,使得一个或多个处理器执行以下步骤:
接收交易回滚指令,交易回滚指令携带回滚模式;
若回滚模式为携带筛选条件和交易批次标识的部分回滚,则从与交易批次标识对应的交易中筛选出满足筛选条件的目标交易;
检测目标交易的交易状态;及
若目标交易的交易状态为已处理,则将目标交易进行回滚。
在其中一个实施例中,筛选条件包括交易产品和交易用户中的至少一种。
在其中一个实施例中,处理器所执行的将目标交易进行回滚的步骤,包括:将目标交易在执行过程中写入数据库的数据变更为执行目标交易前的数据;及将目标交易的交易状态修改为待处理状态。
在其中一个实施例中,处理器执行计算机可读指令时还实现以下步骤:若回滚模式为携带交易数据的部分回滚,则解析交易数据得到交易产品标识、交易申请日期和交易产品持有用户标识;若交易产品标识与预设补录交易产品标识对比一致,且交易申请日期早于当前日期,则查找数据库中存储的与交易产品标识和交易产品持有用户标识均相同且交易申请日期晚于交易申请日期的待回滚交易;及将待回滚交易进行回滚。
在其中一个实施例中,处理器执行计算机可读指令时还实现以下步骤:若回滚模式为携带交易批次标识的全量回滚,则获取与交易批次标识对应的交易;及检测与交易批次标识对应的交易的交易状态,若与交易批次标识对应的交易的交易状态为已处理,则将与交易批次标识对应的交易进行回滚。
一个或多个存储有计算机可读指令的非易失性存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:
接收交易回滚指令,交易回滚指令携带回滚模式;
若回滚模式为携带筛选条件和交易批次标识的部分回滚,则从与交易批次标识对应的交易中筛选出满足筛选条件的目标交易;
检测目标交易的交易状态;及
若目标交易的交易状态为已处理,则将目标交易进行回滚。
在其中一个实施例中,筛选条件包括交易产品和交易用户中的至少一种。
在其中一个实施例中,计算机可读指令被处理器执行时还实现以下步骤:将目标交易在执行过程中写入数据库的数据变更为执行目标交易前的数据;及将目标交易的交易状态修改为待处理状态。
在其中一个实施例中,计算机可读指令被处理器执行时还实现以下步骤:若回滚模式为携带交易数据的部分回滚,则解析交易数据得到交易产品标识、交易申请日期和交易产品持有用户标识;若交易产品标识与预设补录交易产品 标识对比一致,且交易申请日期早于当前日期,则查找数据库中存储的与交易产品标识和交易产品持有用户标识均相同且交易申请日期晚于交易申请日期的待回滚交易;及将待回滚交易进行回滚。
在其中一个实施例中,计算机可读指令被处理器执行时还实现以下步骤:若回滚模式为携带批次标识的全量回滚,则获取与批次标识对应的交易;及检测与交易批次标识对应的交易的交易状态,若与交易批次标识对应的交易的交易状态为已处理,则将与交易批次标识对应的交易进行回滚。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (20)

  1. 一种交易回滚方法,包括:
    接收交易回滚指令,所述交易回滚指令携带回滚模式;
    若所述回滚模式为携带筛选条件和交易批次标识的部分回滚,则从与所述交易批次标识对应的交易中筛选出满足所述筛选条件的目标交易;
    检测所述目标交易的交易状态;及
    若所述目标交易的交易状态为已处理,则将所述目标交易进行回滚。
  2. 根据权利要求1所述的方法,其特征在于,所述将所述目标交易进行回滚,包括:
    将所述目标交易在执行过程中写入数据库的数据变更为执行所述目标交易前的数据;及
    将所述目标交易的交易状态修改为待处理状态。
  3. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    根据预设开启时间启动预设的交易回滚指令,所述交易回滚指令携带回滚模式;
    若所述回滚模式为携带筛选条件和交易批次标识的部分回滚,则从与所述交易批次标识对应的交易中筛选出满足所述筛选条件的目标交易;
    检测所述目标交易的交易状态;及
    若所述目标交易的交易状态为已处理,则将所述目标交易进行回滚。
  4. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    若所述回滚模式为携带交易数据的部分回滚,则解析所述交易数据得到交易产品标识、交易申请日期和交易产品持有用户标识;
    若所述交易产品标识与预设补录交易产品标识对比一致,且所述交易申请日期早于当前日期,则查找数据库中存储的与所述交易产品标识和交易产品持有用户标识均相同且交易申请日期晚于所述交易申请日期的待回滚交易;及
    将所述待回滚交易进行回滚。
  5. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    若所述回滚模式为携带交易批次标识的全量回滚,则获取与所述交易批次 标识对应的交易;
    检测与所述交易批次标识对应的交易的交易状态;及
    若与所述交易批次标识对应的交易的交易状态为已处理,则将与所述交易批次标识对应的交易进行回滚。
  6. 一种交易回滚装置,包括:
    交易回滚指令接收模块,用于接收交易回滚指令,所述交易回滚指令携带回滚模式;
    交易筛选模块,用于若所述回滚模式为携带筛选条件和交易批次标识的部分回滚,则从与所述交易批次标识对应的交易中筛选出满足所述筛选条件的目标交易;
    交易状态检测模块,用于检测所述目标交易的交易状态;及
    交易回滚模块,用于若所述目标交易的交易状态为已处理,则将所述目标交易进行回滚。
  7. 根据权利要求6所述的装置,其特征在于,所述交易回滚模块用于将所述目标交易在执行过程中写入数据库的数据变更为执行所述目标交易前的数据;及将所述目标交易的交易状态修改为待处理状态。
  8. 根据权利要求6所述的装置,其特征在于,所述装置还包括:交易回滚指令启动模块,用于根据预设开启时间启动预设的交易回滚指令,所述交易回滚指令携带回滚模式;所述交易筛选模块用于若所述回滚模式为携带筛选条件和交易批次标识的部分回滚,则从与所述交易批次标识对应的交易中筛选出满足所述筛选条件的目标交易;所述交易状态检测模块用于检测所述目标交易的交易状态;及所述交易回滚模块用于若所述目标交易的交易状态为已处理,则将所述目标交易进行回滚。
  9. 根据权利要求6所述的装置,其特征在于,所述交易回滚模块还用于若所述回滚模式为携带交易数据的部分回滚,则解析所述交易数据得到交易产品标识、交易申请日期和交易产品持有用户标识;若所述交易产品标识与预设补录交易产品标识对比一致,且所述交易申请日期早于当前日期,则查找数据库中存储的与所述交易产品标识和交易产品持有用户标识均相同且交易申请日期 晚于所述交易申请日期的待回滚交易;及将所述待回滚交易进行回滚。
  10. 根据权利要求6所述的装置,其特征在于,所述交易回滚模块还用于若所述回滚模式为携带交易批次标识的全量回滚,则获取与所述交易批次标识对应的交易;检测与所述交易批次标识对应的交易的交易状态;及若与所述交易批次标识对应的交易的交易状态为已处理,则将与所述交易批次标识对应的交易进行回滚。
  11. 一种计算机设备,包括存储器及一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
    接收交易回滚指令,所述交易回滚指令携带回滚模式;
    若所述回滚模式为携带筛选条件和交易批次标识的部分回滚,则从与所述交易批次标识对应的交易中筛选出满足所述筛选条件的目标交易;
    检测所述目标交易的交易状态;及
    若所述目标交易的交易状态为已处理,则将所述目标交易进行回滚。
  12. 根据权利要求11所述的计算机设备,其特征在于,所述处理器执行所述将所述目标交易进行回滚的步骤,包括:
    将所述目标交易在执行过程中写入数据库的数据变更为执行所述目标交易前的数据;及
    将所述目标交易的交易状态修改为待处理状态。
  13. 根据权利要求11所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:
    根据预设开启时间启动预设的交易回滚指令,所述交易回滚指令携带回滚模式;
    若所述回滚模式为携带筛选条件和交易批次标识的部分回滚,则从与所述交易批次标识对应的交易中筛选出满足所述筛选条件的目标交易;
    检测所述目标交易的交易状态;及
    若所述目标交易的交易状态为已处理,则将所述目标交易进行回滚。
  14. 根据权利要求11所述的计算机设备,其特征在于,所述处理器执行所 述计算机可读指令时还执行以下步骤:若所述回滚模式为携带交易数据的部分回滚,则解析所述交易数据得到交易产品标识、交易申请日期和交易产品持有用户标识;
    若所述交易产品标识与预设补录交易产品标识对比一致,且所述交易申请日期早于当前日期,则查找数据库中存储的与所述交易产品标识和交易产品持有用户标识均相同且交易申请日期晚于所述交易申请日期的待回滚交易;及
    将所述待回滚交易进行回滚。
  15. 根据权利要求11所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:
    若所述回滚模式为携带交易批次标识的全量回滚,则获取与所述交易批次标识对应的交易;
    检测与所述交易批次标识对应的交易的交易状态;及
    若与所述交易批次标识对应的交易的交易状态为已处理,则将与所述交易批次标识对应的交易进行回滚。
  16. 一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
    接收交易回滚指令,所述交易回滚指令携带回滚模式;
    若所述回滚模式为携带筛选条件和交易批次标识的部分回滚,则从与所述交易批次标识对应的交易中筛选出满足所述筛选条件的目标交易;
    检测所述目标交易的交易状态;及
    若所述目标交易的交易状态为已处理,则将所述目标交易进行回滚。
  17. 根据权利要求16所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:
    将所述目标交易在执行过程中写入数据库的数据变更为执行所述目标交易前的数据;及
    将所述目标交易的交易状态修改为待处理状态。
  18. 根据权利要求16所述的存储介质,其特征在于,所述计算机可读指令 被所述处理器执行时还执行以下步骤:
    根据预设开启时间启动预设的交易回滚指令,所述交易回滚指令携带回滚模式;
    若所述回滚模式为携带筛选条件和交易批次标识的部分回滚,则从与所述交易批次标识对应的交易中筛选出满足所述筛选条件的目标交易;
    检测所述目标交易的交易状态;及
    若所述目标交易的交易状态为已处理,则将所述目标交易进行回滚。
  19. 根据权利要求16所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:若所述回滚模式为携带交易数据的部分回滚,则解析所述交易数据得到交易产品标识、交易申请日期和交易产品持有用户标识;
    若所述交易产品标识与预设补录交易产品标识对比一致,且所述交易申请日期早于当前日期,则查找数据库中存储的与所述交易产品标识和交易产品持有用户标识均相同且交易申请日期晚于所述交易申请日期的待回滚交易;及
    将所述待回滚交易进行回滚。
  20. 根据权利要求16所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:
    若所述回滚模式为携带交易批次标识的全量回滚,则获取与所述交易批次标识对应的交易;
    检测与所述交易批次标识对应的交易的交易状态;及
    若与所述交易批次标识对应的交易的交易状态为已处理,则将与所述交易批次标识对应的交易进行回滚。
PCT/CN2018/088569 2017-07-31 2018-05-27 交易回滚方法、装置、计算机设备和存储介质 Ceased WO2019024583A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710643873.8 2017-07-31
CN201710643873.8A CN107783861B (zh) 2017-07-31 2017-07-31 交易回滚方法、装置、存储介质和计算机设备

Publications (1)

Publication Number Publication Date
WO2019024583A1 true WO2019024583A1 (zh) 2019-02-07

Family

ID=61437725

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/088569 Ceased WO2019024583A1 (zh) 2017-07-31 2018-05-27 交易回滚方法、装置、计算机设备和存储介质

Country Status (2)

Country Link
CN (1) CN107783861B (zh)
WO (1) WO2019024583A1 (zh)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107783861B (zh) * 2017-07-31 2020-11-24 平安科技(深圳)有限公司 交易回滚方法、装置、存储介质和计算机设备
CN109240735B (zh) * 2018-07-27 2021-09-24 平安科技(深圳)有限公司 需求回滚方案填写方法、装置、终端及可读存储介质
CN109493230B (zh) * 2018-12-28 2020-09-15 中国银行股份有限公司 一种单边交易的补录方法及装置
CN109885422B (zh) * 2018-12-29 2024-01-12 贝壳技术有限公司 一种房产交易系统中配置平台的数据回滚方法和装置
CN112598520B (zh) * 2020-12-28 2024-06-11 中国农业银行股份有限公司 交易管理的方法、装置、电子设备以及存储介质
CN113744056A (zh) * 2021-09-07 2021-12-03 辽宁振兴银行股份有限公司 一种联机交易幂等的方法及装置
CN118115275B (zh) * 2024-03-07 2025-02-11 张家港保税数据科技有限公司 一种交割服务业务回滚方法和系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102571850A (zh) * 2010-12-24 2012-07-11 中国移动通信集团山东有限公司 事务提交系统、方法及设备
CN104794138A (zh) * 2014-01-22 2015-07-22 深圳市沃信科技有限公司 一种数据库交易结果确认方法、装置及系统
CN105659204A (zh) * 2013-08-13 2016-06-08 经度事业闪存公司 用于进行带有注释的原子写入操作的方法和装置
JP5978008B2 (ja) * 2012-05-29 2016-08-24 みずほ情報総研株式会社 取引管理システム、取引管理方法及び取引管理プログラム
CN106991606A (zh) * 2017-03-29 2017-07-28 恒生电子股份有限公司 交易数据处理方法及装置
CN107783861A (zh) * 2017-07-31 2018-03-09 平安科技(深圳)有限公司 交易回滚方法、装置、存储介质和计算机设备

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9104630B1 (en) * 2012-10-24 2015-08-11 Google Inc. Online account reset, rollback, and backup
CN103077019B (zh) * 2012-12-27 2016-07-06 中国建设银行股份有限公司 一种图形化参数批量维护方法和装置
CN105989133B (zh) * 2015-02-25 2019-10-01 阿里巴巴集团控股有限公司 事务处理方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102571850A (zh) * 2010-12-24 2012-07-11 中国移动通信集团山东有限公司 事务提交系统、方法及设备
JP5978008B2 (ja) * 2012-05-29 2016-08-24 みずほ情報総研株式会社 取引管理システム、取引管理方法及び取引管理プログラム
CN105659204A (zh) * 2013-08-13 2016-06-08 经度事业闪存公司 用于进行带有注释的原子写入操作的方法和装置
CN104794138A (zh) * 2014-01-22 2015-07-22 深圳市沃信科技有限公司 一种数据库交易结果确认方法、装置及系统
CN106991606A (zh) * 2017-03-29 2017-07-28 恒生电子股份有限公司 交易数据处理方法及装置
CN107783861A (zh) * 2017-07-31 2018-03-09 平安科技(深圳)有限公司 交易回滚方法、装置、存储介质和计算机设备

Also Published As

Publication number Publication date
CN107783861A (zh) 2018-03-09
CN107783861B (zh) 2020-11-24

Similar Documents

Publication Publication Date Title
WO2019024583A1 (zh) 交易回滚方法、装置、计算机设备和存储介质
US20240242295A1 (en) Ticket processing
WO2020134989A1 (zh) Excel数据的导入方法、装置、计算机设备和存储介质
CN107038645B (zh) 业务处理方法、装置及系统和服务器
CA3157818A1 (en) Method, apparatus, computer device, and storage medium for fusing multi-system multi-store orders
CN108305173B (zh) 理财产品的交易处理方法、装置、计算机设备和存储介质
CN105930259A (zh) 一种web回归测试的方法和装置
CN105335143A (zh) 一种业务处理方法及装置
WO2019033741A1 (zh) 投资产品的资源处理方法、装置、存储介质和计算机设备
CN113094414A (zh) 流转图谱生成方法及装置
CN113971074B (zh) 事务处理方法、装置、电子设备及计算机可读存储介质
CN117874002A (zh) 一种用于异构数据迁移的方法及系统
CN110109798A (zh) 应用程序异常处理方法、装置、计算机设备及存储介质
CN116521343A (zh) 资源交互信息处理方法、装置、计算机设备和存储介质
CN110413614A (zh) 一种数据表生成的方法及装置
CN110941948B (zh) 单据界面的展示方法、装置、设备及存储介质
CN115564390A (zh) 一种交易审查方法、装置、电子设备及存储介质
CN120804457B (zh) 网页自动化任务的检测方法、装置和电子设备
CN115599968B (zh) 交易数据处理方法、装置、计算机设备和存储介质
CN119538916B (zh) 一种异常词汇的检测方法、装置、计算机设备及存储介质
US20260080471A1 (en) System and method for backtesting economic calendar
CN111507566B (zh) 物品生产单的生成方法、装置、计算机设备和存储介质
CN119539720A (zh) 基于工作流系统的数据处理方法、装置、设备及存储介质
CN117649303A (zh) 保全业务受理方法、装置、计算机设备和存储介质
CN120338908A (zh) 产品上下架状态识别方法、装置、计算机设备和存储介质

Legal Events

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

Ref document number: 18841618

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18841618

Country of ref document: EP

Kind code of ref document: A1

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

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

122 Ep: pct application non-entry in european phase

Ref document number: 18841618

Country of ref document: EP

Kind code of ref document: A1