CN107783861A - transaction rollback method, device, storage medium and computer equipment - Google Patents

transaction rollback method, device, storage medium and computer equipment Download PDF

Info

Publication number
CN107783861A
CN107783861A CN201710643873.8A CN201710643873A CN107783861A CN 107783861 A CN107783861 A CN 107783861A CN 201710643873 A CN201710643873 A CN 201710643873A CN 107783861 A CN107783861 A CN 107783861A
Authority
CN
China
Prior art keywords
transaction
rollback
target
mark
data
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.)
Granted
Application number
CN201710643873.8A
Other languages
Chinese (zh)
Other versions
CN107783861B (en
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
Priority to CN201710643873.8A priority Critical patent/CN107783861B/en
Publication of CN107783861A publication Critical patent/CN107783861A/en
Priority to PCT/CN2018/088569 priority patent/WO2019024583A1/en
Application granted granted Critical
Publication of CN107783861B publication Critical patent/CN107783861B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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 operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1438Restarting or rejuvenating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

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

The present invention relates to one kind transaction rollback method, methods described includes:Transaction rollback instruction is received, the transaction rollback instruction carries rollback pattern;If the rollback pattern to carry the partial rollback of screening conditions and batch identification of merchandising, filters out the target transaction for meeting the screening conditions from transaction corresponding with the transaction batch identification;Detect the stateful transaction of the target transaction;If the stateful transaction of the target transaction is processed, the target transaction is subjected to rollback.Using the method, transaction rollback efficiency can be improved.In addition, a kind of transaction rollback method, device, storage medium and computer equipment are additionally provided.

Description

Transaction rollback method, device, storage medium and computer equipment
Technical field
The present invention relates to field of computer technology, more particularly to one kind transaction rollback method, device, storage medium and meter Calculate machine equipment.
Background technology
Transaction rollback refers to that client is directly or indirectly carried out after product bargain transaction (such as fund transaction) on the internet, because Change of parameter transaction etc. causes the data that transaction obtains after performing to become nonsensical (such as same day unit net value of fund transaction Change so that the fund share of user's purchase is changed, it is original perform fund hand over facile fund share there is no With), so as to need to merchandise perform after obtained data recovery to last time correct state.
Traditional transaction rollback method is after the batch received transaction is all performed, and progress full dose of being merchandised to batch is returned Rolling.But when the quantity of batch transaction is larger, the rollback of transaction full dose expends time length so that transaction rollback efficiency is low.
The content of the invention
The embodiments of the invention provide one kind transaction rollback method, device, storage medium and computer equipment, can improve Transaction rollback efficiency.
One kind transaction rollback method, methods described include:
Transaction rollback instruction is received, the transaction rollback instruction carries rollback pattern;
If the rollback pattern is to carry the partial rollback of screening conditions and batch identification of merchandising, criticized from the transaction The target transaction for meeting the screening conditions is filtered out in being merchandised corresponding to secondary mark;
Detect the stateful transaction of the target transaction;
If the stateful transaction of the target transaction is processed, the target transaction is subjected to rollback.
In one of the embodiments, the screening conditions include at least one of products transactions and trade user.
In one of the embodiments, it is described that the target transaction is subjected to rollback, including:The target transaction is being held The data of write into Databasce are changed to perform the data before the target transaction during row;By the transaction shape of the target transaction State is revised as armed state.
In one of the embodiments, methods described also includes:If the rollback pattern is the part of carrying transaction data Rollback, then parse the transaction data obtain products transactions mark, transaction the date of application and products transactions hold user mark;If Products transactions mark is consistent with presetting the mark contrast of amended record products transactions, and the transaction date of application is earlier than working as the day before yesterday Phase, then what is stored in searching data storehouse holds user's mark all same and transaction Shen with products transactions mark and products transactions Please be later than the transaction date of application date treats that rollback is merchandised;Treat that rollback transaction carries out rollback by described.
In one of the embodiments, methods described also includes:If the rollback pattern is carrying transaction batch identification Full dose rollback, then obtain transaction corresponding with the transaction batch identification;Detect the stateful transaction of the target transaction;It is if described The stateful transaction of target transaction is processed, then transaction corresponding with the transaction batch identification is carried out into rollback.
A kind of data rewind device, described device include:
Transaction rollback command reception module, for receiving transaction rollback instruction, the transaction rollback, which instructs, carries rollback mould Formula;
Transaction screening module, if being carrying screening conditions and the part time for batch identification of merchandising for the rollback pattern Rolling, then the target transaction for meeting the screening conditions is filtered out from transaction corresponding with the transaction batch identification;
Stateful transaction detection module, for detecting the stateful transaction of the target transaction;
Transaction roll-back module, if the stateful transaction for the target transaction is processed, the target transaction is entered Row rollback.
In one of the embodiments, the transaction roll-back module is used in the process of implementation write the target transaction The data of database are changed to perform the data before the target transaction;The stateful transaction of the target transaction is revised as waiting to locate Reason state.
In one of the embodiments, if the transaction roll-back module is additionally operable to the rollback pattern to carry transaction data Partial rollback, then parse the transaction data obtain products transactions mark, transaction the date of application and products transactions hold user Mark;If products transactions mark is consistent with presetting the mark contrast of amended record products transactions, and the transaction date of application earlier than Current date, then stored in searching data storehouse with the products transactions mark and products transactions hold user mark all same and Transaction the date of application be later than it is described transaction the date of application treat rollback merchandise;Treat that rollback transaction carries out rollback by described.
A kind of computer-readable recording medium, is stored thereon with computer program, and the program is realized when being executed by processor Following steps:
Transaction rollback instruction is received, the transaction rollback instruction carries rollback pattern;
If the rollback pattern is to carry the partial rollback of screening conditions and batch identification of merchandising, criticized from the transaction The target transaction for meeting the screening conditions is filtered out in being merchandised corresponding to secondary mark;
Detect the stateful transaction of the target transaction;
If the stateful transaction of the target transaction is processed, the target transaction is subjected to rollback.
A kind of computer equipment, the computer equipment include memory, processor and are stored on the memory simultaneously The computer program that can be run on the processor, following steps are realized during calculator program described in the computing device:
Transaction rollback instruction is received, the transaction rollback instruction carries rollback pattern;
If the rollback pattern is to carry the partial rollback of screening conditions and batch identification of merchandising, criticized from the transaction The target transaction for meeting the screening conditions is filtered out in being merchandised corresponding to secondary mark;
Detect the stateful transaction of the target transaction;
If the stateful transaction of the target transaction is processed, the target transaction is subjected to rollback.
Above-mentioned transaction rollback method, device, storage medium and computer equipment, instructed by receiving transaction rollback, transaction Rollback instruction carry rollback pattern, if rollback pattern for carry screening conditions and merchandise batch identification partial rollback, from The target transaction for meeting the screening conditions is filtered out in being merchandised corresponding to transaction batch identification, detects the transaction shape of target transaction State, if the stateful transaction of target transaction is processed, target transaction is subjected to rollback.When batch transaction is being performed or held After row, it is found that the parameter that batch is partly merchandised in merchandising changes, it is only necessary to the part is merchandised and carries out rollback, is compared In the part exchange is carried out into full dose rollback in the All Activity of batch, transaction rollback efficiency is improved.
Brief description of the drawings
Fig. 1 is the applied environment figure of transaction rollback method in one embodiment;
Fig. 2 is the cut-away view of server in one embodiment;
Fig. 3 is the flow chart of transaction rollback method in one embodiment;
Fig. 4 is the flow chart of target transaction rollback method in one embodiment;
Fig. 5 is the flow chart of amended record Transaction section rollback method in one embodiment;
Fig. 6 is the flow chart of full dose rollback method of being merchandised in batches in one embodiment;
Fig. 7 is the flow chart of transaction rollback method in another embodiment;
Fig. 8 is the structured flowchart of transaction rollback device in one embodiment.
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and Examples The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and It is not used in the restriction present invention.
Transaction rollback method provided in an embodiment of the present invention can be applied in environment as shown in Figure 1.With reference to shown in figure 1, The transaction rollback instruction that the receiving terminal 104 of server 102 is sent.Specifically, server 102 is carried out by network and terminal 104 Communication, the transaction rollback instruction that the receiving terminal 104 of server 102 is sent, transaction rollback instruction carry rollback pattern;If rollback mould Formula then filters out to carry the partial rollback of screening conditions and batch identification of merchandising from transaction corresponding with transaction batch identification Meet the target transaction of screening conditions;Detect the stateful transaction of target transaction;If the stateful transaction of target transaction is processed, Target transaction is subjected to rollback.Here terminal include but is not limited to various personal computers, notebook computer, smart mobile phone, Tablet personal computer, portable wearable device etc..It should be noted that transaction rollback method provided in an embodiment of the present invention can also only lead to Cross server 102.
In one embodiment, as shown in Fig. 2 additionally providing a kind of server, the server includes passing through system bus Processor, non-volatile memory medium, built-in storage, the network connection mouth of connection, behaviour is stored with non-volatile memory medium Make system and computer executable instructions, the computer executable instructions are used to realize that what is provided in the embodiment of the present application is applied to The medical services reserving method of server.The processor is used to improve calculating and control ability, supports the operation of whole server. Built-in storage is used to provide environment for the operating system in non-volatile memory medium and the operation of computer executable instructions.Net Network interface is used to carry out network service with terminal.It will be understood by those skilled in the art that the structure shown in Fig. 2, only with The block diagram of the related part-structure of application scheme, the limit for the server being applied thereon to application scheme is not formed Fixed, specifically server can include, than more or less parts shown in figure, either combining some parts or with not Same part arrangement.
In one embodiment, as shown in Figure 3, there is provided one kind transaction rollback method, this method is with applied in such as Fig. 2 Server illustrate, including:
Step 302, transaction rollback instruction is received, transaction rollback instruction carries rollback pattern.
Transaction rollback refers to that client is directly or indirectly carried out after product bargain transaction (such as fund transaction) on the internet, because Change of parameter transaction etc. cause transaction perform after obtained data become that nonsensical (such as fund buys in the same day unit of transaction Net value is changed so that the fund share of user's purchase is changed, and original fund that performs hands over facile fund share There is no with), so as to need to merchandise perform after obtained data recovery to last time correct state.
Transaction rollback instruction can be pre-set time opening instruction or operating personnel it is real-time by terminal The instruction of initiation.In one embodiment, server starts default transaction rollback according to the default opening time and instructed, and such as 2017 The 6 pm on the 5th and 25 in year opens transaction rollback instruction, and the data for showing rollback pattern are carried in transaction rollback instruction, Screening conditions and transaction batch identification are carried in rollback of such as merchandising instruction, then show that rollback pattern is and batch identification pair of merchandising Partial rollback in the transaction answered, if transaction rollback instruction in only carry transaction batch identification, show rollback pattern be with The full dose rollback of the corresponding transaction of batch identification of merchandising.In other embodiments, terminal operation personnel, which first input, shows rollback mould The data of formula, specifically, the dimension of screening conditions can be selected in the screening conditions drop-down list provided, then in text box it is defeated Enter to correspond to the specific screening form of screening conditions dimension, the screening conditions dimension of such as selection is products transactions, in text box Input products transactions title or products transactions mark, and/or provide batch identification input frame (or in choice box) input (or Select) to carry out the exchange of rollback batch identification, then merchandised back to server transmission by clicking on " transmissions " button Rolling instruction.
Rollback pattern includes full dose rollback and partial rollback.Full dose rollback refers to carry out the batched transaction data received Rollback, wherein, batched transaction data can be using transaction data of the date of application as batch identification of merchandising.Specifically, transaction Shen It please can be a certain exact date (such as on July 2nd, 2017) or sometime scope (such as 2 days to 2017 June in 2017 on the date July 2).
Step 304, if rollback pattern is to carry the partial rollback of screening conditions and batch identification of merchandising, criticized from transaction The target transaction for meeting screening conditions is filtered out in being merchandised corresponding to secondary mark.
Screening conditions be according to reality transactions demand make come.In the present embodiment, screening conditions include transaction and produced At least one of two dimensions of product and trade user.Specifically, the form of expression of products transactions can be products transactions title, Products transactions type or products transactions mark (such as product coding);The form of expression of trade user can be transaction Product holds user's name or products transactions hold user's mark (such as user identity card number).It should be noted that Screening conditions are not limited to the screening conditions that the present embodiment includes two dimensions of products transactions and trade user come, in fact Apply in example, the screening conditions of other dimensions can be also made according to real trade demand.
Transaction batch identification is used for the batch transaction that unique mark receives, and can be the transaction date of application, such as specifically Batch 20170405, or using deformation of the date of application as substrate character string of merchandising, such as the He of batch 20170405001 20170405002 or custom rule generation transaction batch identification, such as batch S342209A.In addition, for connecing The quantity for receiving transaction batch identification does not limit, and can be one or multiple.
Target transaction is to be screened according to screening conditions and transaction batch identification in the transaction of server storage.Its In, the transaction of server storage is obtained from sales platforms such as banks.For example, screening conditions are fund product identifications is 004282, transaction batch identification is 20160504, then target transaction is the fund transaction carried out on May 4th, 2016 this day In, user's purchase or the fund that redemption fund product identification is 004282 are merchandised;Or screening conditions are that use is held in fund transaction Family is identified as 342401196802058475, and transaction batch identification is 20160504,20160505,20160506, then target is handed over Easily user corresponding to 342401196802058475 is identified as user in three days Mays 6 day of 4 days to 2016 May in 2016 to enter Capable fund transaction.
Step 306, the stateful transaction of target transaction is detected.
For the big products transactions of trading volume, transaction data is handled using multi-threaded parallel execution pattern, therefore screening After going out target transaction, it is also necessary to detect the stateful transaction of target transaction.Stateful transaction includes pending, processing and neutralizes processed three Kind state.Specifically, after the transaction data for the carrying transaction batch identification that server receiving terminal uploads, by the transaction data Store in database, and be labeled as armed state;Server again in timing Test database whether state to be handled Transaction, if so, being then state in processing by the processing Status Change of the transaction, and the friendship is performed according to default transaction executing rule Easily;When the transaction successful execution finishes, in a fund purchase-transaction, server is successfully by fund part of this fund transaction Volume write into Databasce, and be sent to user terminal, will by the processing Status Change of the transaction be then processed state.
In the present embodiment, it is necessary to detect after the target transaction for meeting screening conditions is found out during the batch received is merchandised The stateful transaction of target transaction, the subsequent operation according to corresponding to being carried out stateful transaction.
Step 308, if the stateful transaction of target transaction is processed, target transaction is subjected to rollback.
In the present embodiment, if the stateful transaction of target transaction to be processed, illustrates in the batch transaction that is carrying out, mesh Mark transaction has been disposed, then can carry out rollback to target transaction, during the batch for being still within execution state is merchandised Non-targeted transaction does not influence;Or the batch transaction of batch where target transaction is processed and finished, then can hand over target Easily carry out rollback.In addition, handed over after target transaction rollback success, it is necessary to perform variation of parameter value according to transaction and re-execute target Easily, so that the data that server obtains after target transaction is re-executed are sent to terminal.For example client was on March 7th, 2017 2000 yuan have been spent to have purchased a kind of fund, the unit net value that server gets the fund on March 7th, 2017 is 1 yuan/part, is accused Person in charge of reception at ceremonies family have purchased 2000 parts of funds, and on March 8th, 2017, the unit net value of the fund was 1.5 yuan/part, it is therefore desirable to is serviced Device is transacted business rollback, account assets of the client on March 8th, 2017 is become the account total assets on March 6th, 2017, is Sky, then the unit net value data in the fund on March 8th, 2017 are re-read, possess 3000 yuan of assets so as to calculate client.
In the present embodiment, merchandise in batches after being performed or be finished, part during the batch for finding to receive is merchandised The parameter of transaction changes, it is only necessary to the part merchandise carry out rollback, compared to by the part exchange batch institute There is transaction to carry out full dose rollback, improve transaction rollback efficiency.
In one embodiment, the step of as shown in figure 4, by target transaction progress rollback, including:
Step 318, before the data of target transaction write into Databasce in the process of implementation being changed into performance objective transaction Data.
The execution flow of transaction is pre-set, and the data for the write into Databasce in the process of implementation of merchandising are true Fixed.For example, the execution flow of each fund transaction is:Fund type of transaction is read, if fund type of transaction is purchase, Fund dealing money is read, the unit net value for the fund transaction date of application that ACCNAV interface provides is obtained, is handed over according to fund The easy amount of money and unit net value calculate user and hold share, are held according to the user's history that the user being calculated holds share and prestores Having share to calculate, user is current holds share, obtains the current one net value of fund, holds share and current according to active user Unit net value calculates current asset net value;If fund type of transaction is to redeem, reads user and hold share, obtain ACCNAV The unit net value for the fund transaction date of application that interface provides, share is held according to user and unit net value calculates user and redeems gold Volume, the current one net value of fund is obtained, share calculating is held according to the current one net value of fund, the user's history to prestore and worked as Preceding Net asset value.Therefore, fund transaction is exactly that user holds share or user's redemption in the data of implementation procedure write into Databasce The amount of money.So, the rollback for target transaction by the user of target transaction write into Databasce in the process of implementation, it is necessary to hold part Numerical value corresponding to numerical value corresponding to volume (fund type of transaction is purchase) or user's redemption money (fund type of transaction is to redeem) The null value being modified to carry out before transaction, current asset net value are changed to the historic asset net value before transaction performs.
Step 328, the stateful transaction of target transaction is revised as armed state.
After target transaction performs, stateful transaction can be changed to " processed " state.So, returning for target transaction Rolling by stateful transaction, it is necessary to be revised as " pending " state.
In the present embodiment, the rollback of target transaction is realized by program code, rather than target transaction is carried out by database Rollback, when the rollback of target transaction goes wrong, can alignment error position in real time, re-start number to solve a problem promptly According to rollback, the ageing of trading processing ensure that.
In one embodiment, as shown in figure 5, after step 308, in addition to:
Step 502, if rollback pattern is carries the partial rollback of transaction data, parsing transaction data obtains products transactions Mark, transaction date of application and products transactions hold user's mark.
In the present embodiment, transaction data is user to carry on transactions the number of operation generation directly or indirectly through internet According to.For example, fund transaction data includes:Fund holds user's mark, fund type of transaction, fund mark, fund transaction application Date, dealing money or user hold share etc..
Step 504, if products transactions mark is consistent with presetting the mark contrast of amended record products transactions, and the date of application of merchandising is early In current date, then what is stored in searching data storehouse holds user's mark all same and friendship with products transactions mark and products transactions What the easy date of application was later than the transaction date of application treats that rollback is merchandised.
In the present embodiment, if products transactions mark is consistent with presetting the mark contrast of amended record products transactions, illustrate this transaction production Product are the products transactions that can be traded data amended record operation, also, the transaction date of application earlier than system current date, illustrates current Carry out the amended record of the transaction data of the products transactions.So, after transaction data amended record to the system by the products transactions, Perform before the amended record transaction data, it is necessary to which the All Activity data after the date of application of being merchandised to amended record carry out rollback.
For example, for the small fund product of some trading volumes, system is not to be carried out batch daily to merchandise, but is entered afterwards Row transaction amended record.Using merchandise the date of application as transaction batch identification exemplified by carry out it is as described below:When appearance transaction batch identification For 20170605 transaction elder generation typing, after the transaction that transaction batch identification is 20170302 during typing, batch mark of merchandising is being performed Transaction data rollback is first carried out before knowing the transaction for 20170302, i.e., first the number of deals that transaction batch identification is 20170605 According to revert to transaction batch identification be 20170301 state.
Step 506, it will treat that rollback transaction carries out rollback.
In the present embodiment, the processing for the less transaction data of trading volume uses single thread execution pattern, therefore, is holding , it is necessary to determine after the transaction of rollback before row amended record transaction, it will directly treat that rollback transaction data carries out rollback:Rollback will be treated The data value of write into Databasce is changed to perform the data value before treating rollback transaction in the process of implementation for transaction, will treat that rollback is merchandised Stateful transaction be revised as armed state.
In the present embodiment, the rollback method that partial rollback is carried out for the huge products transactions of trading volume is provide not only, Additionally provide the rollback method for carrying out partial rollback because of amended record transaction for the small products transactions of trading volume so that system can The rollback of different modes is carried out according to the trading volume size of products transactions, improves the flexibility of transaction rollback.
In one embodiment, as shown in fig. 6, after step 308, in addition to:
Step 602, if rollback pattern obtains and transaction batch identification pair to carry the full dose rollback of transaction batch identification The transaction answered.
Similarly, batch identification of merchandising is used for the batch transaction that unique mark receives, and can be transaction application specifically Date, or the deformation using the date of application of merchandising as substrate character string or the transaction batch mark of custom rule generation Know etc..It can be one or multiple in addition, not limited for the quantity for receiving transaction batch identification.
Step 604, the stateful transaction of detection transaction corresponding with transaction batch identification.
Similarly, for the big products transactions of trading volume, transaction data is handled using multi-threaded parallel execution pattern, because This, after transaction corresponding with transaction batch identification is obtained, it is also necessary to detect the stateful transaction of the transaction.Stateful transaction includes treating Processing, processing neutralize processed three kinds of states.
Step 606, will be with batch mark of merchandising if the stateful transaction merchandised corresponding with transaction batch identification is processed Transaction carries out rollback corresponding to knowing.
When the stateful transaction for receiving only transaction batch identification and determining to merchandise corresponding to the transaction ID is processed, Then batch corresponding with the transaction batch identification received is merchandised and carries out rollback:Transaction corresponding with transaction batch identification is existed The data of write into Databasce are changed to perform the data before transaction corresponding with transaction batch identification in implementation procedure;Will be with transaction Stateful transaction is revised as armed state corresponding to batch identification.
In the present embodiment, the rollback side that partial rollback can be carried out for the huge products transactions of trading volume provide not only Method, additionally provide the rollback method that full dose rollback is carried out for the batched transaction data received so that system can be carried out not With the rollback of mode, the flexibility of transaction rollback is improved.
In one embodiment, as shown in Figure 7, there is provided another kind transaction rollback method, including:
Step 702, transaction rollback instruction is received, transaction rollback instruction carries rollback pattern.
Similarly, merchandise rollback instruction can be pre-set time opening instruction or operating personnel pass through The instruction that terminal is initiated in real time;Rollback pattern includes full dose rollback and partial rollback.
Step 704, if rollback pattern is to carry the partial rollback of screening conditions and batch identification of merchandising, criticized from transaction The target transaction for meeting screening conditions is filtered out in being merchandised corresponding to secondary mark.
Screening conditions be according to reality transactions demand make come.In the present embodiment, screening conditions include transaction and produced At least one of two dimensions of product and trade user.Specifically, the form of expression of products transactions can be products transactions title, Products transactions type or products transactions mark etc.;The form of expression of trade user can be that products transactions hold user Title or products transactions hold user's mark etc..Enumerated it should be noted that screening conditions are not limited to the present embodiment The screening conditions of two dimensions of products transactions and trade user out, can also be according to real trade demand in embodiment Make the screening conditions of other dimensions.
Transaction batch identification is used for the batch transaction that unique mark receives.In the present embodiment, for receiving transaction batch The quantity of secondary mark does not limit, and can be one or multiple.
Step 706, the stateful transaction of target transaction is detected.
For the big products transactions of trading volume, transaction data is handled using multi-threaded parallel execution pattern, therefore receiving To batch transaction in find out after the target transaction for meeting screening conditions, it is necessary to the stateful transaction of target transaction be detected, according to friendship Subsequent operation corresponding to easy state progress.
Step 708, if the stateful transaction of target transaction is processed, target transaction is subjected to rollback.
Stateful transaction includes pending, processing and neutralizes processed three states.After only target transaction execution terminates, just may be used Carry out rollback.
Step 710, if rollback pattern is carries the partial rollback of transaction data, parsing transaction data obtains products transactions Mark, transaction date of application and products transactions hold user's mark.
Transaction data is user to carry on transactions the data of operation generation directly or indirectly through internet.For example, base Golden transaction data includes:Fund holds user's mark, fund type of transaction, fund mark, fund transaction date of application, trade gold Volume or user hold share etc..
Step 712, if products transactions mark is consistent with presetting the mark contrast of amended record products transactions, and the date of application of merchandising is early In current date, then what is stored in searching data storehouse holds user's mark all same and friendship with products transactions mark and products transactions What the easy date of application was later than the transaction date of application treats that rollback is merchandised.
If products transactions are identified with presetting the contrast of amended record products transactions mark unanimously, it is to be handed over to illustrate this products transactions The products transactions of easy data amended record operation, also, the transaction date of application earlier than system current date, illustrate currently to carry out the transaction The amended record of the transaction data of product.So, after transaction data amended record to the system by the products transactions, handed over performing the amended record , it is necessary to which the All Activity data after the date of application of being merchandised to amended record carry out rollback before easy data.
Step 714, it will treat that rollback transaction carries out rollback.
Processing for the less transaction data of trading volume uses single thread execution pattern, therefore, is performing amended record transaction It is preceding, it is necessary to determining after the transaction of rollback, will directly treat that rollback transaction data carries out rollback.
Step 716, if rollback pattern obtains and transaction batch identification pair to carry the full dose rollback of transaction batch identification The transaction answered.
When receiving only transaction batch identification, illustrate to be currently needed for carrying out full dose to transaction corresponding to transaction batch identification Rollback.
Step 718, the stateful transaction of detection transaction corresponding with transaction batch identification.
For the big products transactions of trading volume, transaction data is handled using multi-threaded parallel execution pattern, therefore, obtained After transaction corresponding with transaction batch identification, it is also necessary to detect the stateful transaction of the transaction.
Step 720, will be with batch mark of merchandising if the stateful transaction merchandised corresponding with transaction batch identification is processed Transaction carries out rollback corresponding to knowing.
After the corresponding transaction of the transaction batch identification that obtains with receive and determine transaction corresponding to the transaction ID Stateful transaction to be processed, the transaction is subjected to full dose rollback.
In the present embodiment, the rollback method that partial rollback is carried out for the huge products transactions of trading volume is provide not only, The rollback method for carrying out partial rollback because of amended record transaction for the small products transactions of trading volume is additionally provided, and for receiving The batched transaction data arrived carries out the rollback method of full dose rollback so that system can be entered according to the trading volume size of products transactions The rollback of row different modes, improve the flexibility of transaction rollback.
In one embodiment, as shown in Figure 8, there is provided one kind transaction rollback device, including:
Transaction rollback command reception module 802, for receiving transaction rollback instruction, transaction rollback, which instructs, carries rollback mould Formula.
Transaction screening module 804, if for rollback pattern to carry the partial rollback of screening conditions and batch identification of merchandising, The target transaction for meeting screening conditions is then filtered out from transaction corresponding with transaction batch identification.
Stateful transaction detection module 806, for detecting the stateful transaction of target transaction.
Transaction roll-back module 808, if the stateful transaction for target transaction is processed, target transaction is returned Rolling.
In one embodiment, screening conditions include products transactions and products transactions hold at least one of user.
In one embodiment, the roll-back module 808 of merchandising is used for target transaction write into Databasce in the process of implementation Data are changed to the data before performance objective transaction;The stateful transaction of target transaction is revised as armed state.
In one embodiment, returned if transaction roll-back module 808 is additionally operable to rollback pattern to carry the part of transaction data Rolling, then parse transaction data obtain products transactions mark, transaction the date of application and products transactions hold user mark;If transaction production Product identify and to preset the mark contrast of amended record products transactions consistent, and the date of application of merchandising earlier than current date, then searching data storehouse Middle storage with products transactions mark and products transactions hold user identify all same and transaction the date of application be later than transaction apply Date treats that rollback is merchandised;It will treat that rollback transaction carries out rollback.
In one embodiment, if transaction roll-back module 808 is additionally operable to rollback pattern to carry the complete of transaction batch identification Rollback is measured, then obtains transaction corresponding with transaction batch identification;The stateful transaction of transaction corresponding with transaction batch identification is detected, If the stateful transaction merchandised corresponding with transaction batch identification is processed, transaction corresponding with transaction batch identification is carried out Rollback.
In one embodiment, there is provided a kind of computer-readable recording medium, be stored thereon with computer program, the journey Following steps are realized when sequence is executed by processor:
Transaction rollback instruction is received, transaction rollback instruction carries rollback pattern;
If rollback pattern for carry screening conditions and merchandise batch identification partial rollback, from merchandise batch identification pair The target transaction for meeting screening conditions is filtered out in the transaction answered;
Detect the stateful transaction of target transaction;
If the stateful transaction of target transaction is processed, target transaction is subjected to rollback.
In one embodiment, screening conditions include at least one of products transactions and trade user.
In one embodiment, performed by processor by target transaction carry out rollback the step of, including:By target transaction The data of write into Databasce are changed to the data before performance objective transaction in the process of implementation;The stateful transaction of target transaction is repaiied It is changed to armed state.
In one embodiment, the program performed by processor also comprises the following steps:If rollback pattern is merchandised to carry The partial rollback of data, then parse transaction data obtain products transactions mark, transaction the date of application and products transactions hold user Mark;If products transactions identify and to preset the mark contrast of amended record products transactions consistent, and the date of application of merchandising earlier than current date, What is then stored in searching data storehouse holds user's mark all same and transaction date of application with products transactions mark and products transactions Be later than the transaction date of application treats that rollback is merchandised;It will treat that rollback transaction carries out rollback.
In one embodiment, the program performed by the processor performed by processor also comprises the following steps:If rollback Pattern then obtains transaction corresponding with transaction batch identification to carry the full dose rollback of transaction batch identification;Detection and transaction batch The stateful transaction of transaction corresponding to secondary mark, will if the stateful transaction merchandised corresponding with transaction batch identification is processed Transaction corresponding with transaction batch identification carries out rollback.
In one embodiment, a kind of computer equipment, computer equipment include memory, processor and are stored in storage Following steps are realized on device and the computer program that can run on a processor, during computing device calculator program:
Transaction rollback instruction is received, transaction rollback instruction carries rollback pattern;
If rollback pattern for carry screening conditions and merchandise batch identification partial rollback, from merchandise batch identification pair The target transaction for meeting screening conditions is filtered out in the transaction answered;
Detect the stateful transaction of target transaction;
If the stateful transaction of target transaction is processed, target transaction is subjected to rollback.
In one embodiment, screening conditions include at least one of products transactions and trade user.
In one embodiment, performed by processor by target transaction carry out rollback the step of, including:By target transaction The data of write into Databasce are changed to the data before performance objective transaction in the process of implementation;The stateful transaction of target transaction is repaiied It is changed to armed state.
In one embodiment, the program performed by processor also comprises the following steps:If rollback pattern is merchandised to carry The partial rollback of data, then parse transaction data obtain products transactions mark, transaction the date of application and products transactions hold user Mark;If products transactions identify and to preset the mark contrast of amended record products transactions consistent, and the date of application of merchandising earlier than current date, What is then stored in searching data storehouse holds user's mark all same and transaction date of application with products transactions mark and products transactions Be later than the transaction date of application treats that rollback is merchandised;It will treat that rollback transaction carries out rollback.
In one embodiment, the program performed by the processor performed by processor also comprises the following steps:If rollback Pattern then obtains transaction corresponding with batch identification to carry the full dose rollback of batch identification;Detection and transaction batch identification pair The stateful transaction for the transaction answered, will be with transaction batch if the stateful transaction merchandised corresponding with transaction batch identification is processed Transaction carries out rollback corresponding to secondary mark.
Each technical characteristic of embodiment described above can be combined arbitrarily, to make description succinct, not to above-mentioned reality Apply all possible combination of each technical characteristic in example to be all described, as long as however, the combination of these technical characteristics is not deposited In contradiction, the scope that this specification is recorded all is considered to be.
Embodiment described above only expresses the several embodiments of the present invention, and its description is more specific and detailed, but simultaneously Can not therefore it be construed as limiting the scope of the patent.It should be pointed out that come for one of ordinary skill in the art Say, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to the protection of the present invention Scope.Therefore, the protection domain of patent of the present invention should be determined by the appended claims.

Claims (10)

1. one kind transaction rollback method, methods described include:
Transaction rollback instruction is received, the transaction rollback instruction carries rollback pattern;
If the rollback pattern for carry screening conditions and merchandise batch identification partial rollback, from it is described transaction batch mark The target transaction for meeting the screening conditions is filtered out in being merchandised corresponding to knowing;
Detect the stateful transaction of the target transaction;
If the stateful transaction of the target transaction is processed, the target transaction is subjected to rollback.
2. according to the method for claim 1, it is characterised in that the screening conditions are included in products transactions and trade user At least one.
3. according to the method for claim 1, it is characterised in that it is described that the target transaction is subjected to rollback, including:
The data of target transaction write into Databasce in the process of implementation are changed to perform to the data before the target transaction;
The stateful transaction of the target transaction is revised as armed state.
4. according to the method for claim 1, it is characterised in that methods described also includes:
If the rollback pattern parses the transaction data and obtains products transactions mark to carry the partial rollback of transaction data Know, transaction date of application and products transactions hold user's mark;
If products transactions mark is consistent with presetting the mark contrast of amended record products transactions, and the transaction date of application is earlier than working as The preceding date, then what is stored in searching data storehouse holds user's mark all same and friendship with products transactions mark and products transactions What the easy date of application was later than the transaction date of application treats that rollback is merchandised;
Treat that rollback transaction carries out rollback by described.
5. according to the method for claim 1, it is characterised in that methods described also includes:
If the rollback pattern obtains corresponding with the transaction batch identification to carry the full dose rollback of transaction batch identification Transaction;
Detect the stateful transaction of transaction corresponding with the transaction batch identification;
, will be with the transaction batch identification pair if the stateful transaction merchandised corresponding with the transaction batch identification is processed The transaction answered carries out rollback.
6. a kind of batch data rollback device, it is characterised in that described device includes:
Transaction rollback command reception module, for receiving transaction rollback instruction, the transaction rollback, which instructs, carries rollback pattern.
Transaction screening module, if for the rollback pattern to carry the partial rollback of screening conditions and batch identification of merchandising, The target transaction for meeting the screening conditions is filtered out from transaction corresponding with the transaction batch identification;
Stateful transaction detection module, for detecting the stateful transaction of the target transaction;
Transaction roll-back module, if the stateful transaction for the target transaction is processed, the target transaction is returned Rolling.
7. device according to claim 6, it is characterised in that the transaction roll-back module is used to exist the target transaction The data of write into Databasce are changed to perform the data before the target transaction in implementation procedure;By the transaction of the target transaction Status modifier is armed state.
8. device according to claim 6, it is characterised in that if the transaction roll-back module is additionally operable to the rollback pattern To carry the partial rollback of transaction data, then parse the transaction data and obtain products transactions mark, transaction date of application and friendship Easy product holds user's mark;If the products transactions mark is consistent with presetting the mark contrast of amended record products transactions, and the friendship The easy date of application, what is then stored in searching data storehouse held use with products transactions mark and products transactions earlier than current date Family identify all same and merchandise the date of application be later than it is described transaction the date of application treat rollback merchandise;By it is described treat rollback merchandise into Row rollback.
9. a kind of computer-readable recording medium, is stored thereon with computer program, it is characterised in that the program is held by processor Realized during row as any one of claim 1 to 5 the step of method.
10. a kind of computer equipment, the computer equipment includes memory, processor and is stored on the memory and can The computer program run on the processor, such as claim 1 is realized described in the computing device during calculator program To any one of 5 the step of method.
CN201710643873.8A 2017-07-31 2017-07-31 Transaction rollback method, device, storage medium and computer equipment Active CN107783861B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710643873.8A CN107783861B (en) 2017-07-31 2017-07-31 Transaction rollback method, device, storage medium and computer equipment
PCT/CN2018/088569 WO2019024583A1 (en) 2017-07-31 2018-05-27 Transaction rollback method and apparatus, computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710643873.8A CN107783861B (en) 2017-07-31 2017-07-31 Transaction rollback method, device, storage medium and computer equipment

Publications (2)

Publication Number Publication Date
CN107783861A true CN107783861A (en) 2018-03-09
CN107783861B CN107783861B (en) 2020-11-24

Family

ID=61437725

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710643873.8A Active CN107783861B (en) 2017-07-31 2017-07-31 Transaction rollback method, device, storage medium and computer equipment

Country Status (2)

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

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109240735A (en) * 2018-07-27 2019-01-18 平安科技(深圳)有限公司 Demand rollback scheme filling method, device, terminal and readable storage medium storing program for executing
WO2019024583A1 (en) * 2017-07-31 2019-02-07 平安科技(深圳)有限公司 Transaction rollback method and apparatus, computer device and storage medium
CN109493230A (en) * 2018-12-28 2019-03-19 中国银行股份有限公司 A kind of amended record method and device of unilateral transaction
CN109885422A (en) * 2018-12-29 2019-06-14 贝壳技术有限公司 The data rewind method and apparatus of configuration platform in a kind of house prosperity transaction system
CN112598520A (en) * 2020-12-28 2021-04-02 中国农业银行股份有限公司 Transaction management method, device, electronic equipment and storage medium
CN113744056A (en) * 2021-09-07 2021-12-03 辽宁振兴银行股份有限公司 Online transaction idempotent method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103077019A (en) * 2012-12-27 2013-05-01 中国建设银行股份有限公司 Batch maintenance method and device for graphical parameters
CN104794138A (en) * 2014-01-22 2015-07-22 深圳市沃信科技有限公司 Method, device and system for determining database transaction result
US9104630B1 (en) * 2012-10-24 2015-08-11 Google Inc. Online account reset, rollback, and backup
CN105659204A (en) * 2013-08-13 2016-06-08 经度事业闪存公司 Method and apparatus for performing annotated atomic write operations
CN105989133A (en) * 2015-02-25 2016-10-05 阿里巴巴集团控股有限公司 Transaction processing method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102571850B (en) * 2010-12-24 2014-08-06 ***通信集团山东有限公司 Transaction committing system, method and equipment
JP5978008B2 (en) * 2012-05-29 2016-08-24 みずほ情報総研株式会社 Transaction management system, transaction management method, and transaction management program
CN106991606B (en) * 2017-03-29 2020-09-18 恒生电子股份有限公司 Transaction data processing method and device
CN107783861B (en) * 2017-07-31 2020-11-24 平安科技(深圳)有限公司 Transaction rollback method, device, storage medium and computer equipment

Patent Citations (5)

* 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
CN103077019A (en) * 2012-12-27 2013-05-01 中国建设银行股份有限公司 Batch maintenance method and device for graphical parameters
CN105659204A (en) * 2013-08-13 2016-06-08 经度事业闪存公司 Method and apparatus for performing annotated atomic write operations
CN104794138A (en) * 2014-01-22 2015-07-22 深圳市沃信科技有限公司 Method, device and system for determining database transaction result
CN105989133A (en) * 2015-02-25 2016-10-05 阿里巴巴集团控股有限公司 Transaction processing method and device

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019024583A1 (en) * 2017-07-31 2019-02-07 平安科技(深圳)有限公司 Transaction rollback method and apparatus, computer device and storage medium
CN109240735A (en) * 2018-07-27 2019-01-18 平安科技(深圳)有限公司 Demand rollback scheme filling method, device, terminal and readable storage medium storing program for executing
CN109240735B (en) * 2018-07-27 2021-09-24 平安科技(深圳)有限公司 Requirement rollback scheme filling method and device, terminal and readable storage medium
CN109493230A (en) * 2018-12-28 2019-03-19 中国银行股份有限公司 A kind of amended record method and device of unilateral transaction
CN109885422A (en) * 2018-12-29 2019-06-14 贝壳技术有限公司 The data rewind method and apparatus of configuration platform in a kind of house prosperity transaction system
CN112598520A (en) * 2020-12-28 2021-04-02 中国农业银行股份有限公司 Transaction management method, device, electronic equipment and storage medium
CN112598520B (en) * 2020-12-28 2024-06-11 中国农业银行股份有限公司 Transaction management method, device, electronic equipment and storage medium
CN113744056A (en) * 2021-09-07 2021-12-03 辽宁振兴银行股份有限公司 Online transaction idempotent method and device

Also Published As

Publication number Publication date
CN107783861B (en) 2020-11-24
WO2019024583A1 (en) 2019-02-07

Similar Documents

Publication Publication Date Title
CN107783861A (en) transaction rollback method, device, storage medium and computer equipment
KR102408476B1 (en) Method for predicing purchase probability based on behavior sequence of user and apparatus therefor
CN110363666B (en) Information processing method, apparatus, computing device and storage medium
US11900271B2 (en) Self learning data loading optimization for a rule engine
US9712627B2 (en) User interface provisioning system
CN107230092B (en) Accounting processing method and device and server
EP2761559A1 (en) System and method for joint use of gift codes and coupon codes
KR20140090088A (en) Context-based keyboard
US11250433B2 (en) Using semi-supervised label procreation to train a risk determination model
US20200074433A1 (en) Processing a transaction using multiple payment accounts by a payment network
CN107679988A (en) Fund group purchase method, system and storage medium
CN106484524A (en) A kind of task processing method and device
CN112581226A (en) Product recommendation method and system
JP2017054495A (en) Preliminary credit frame and recommendation credit frame calculation device
US20050165596A1 (en) Method and apparatus for determining expected values in the presence of uncertainty
US20120079087A1 (en) Online help system using session details
US11514532B1 (en) Transaction data transfer management
EP3011512A1 (en) Extensible interface for synchronous and asynchronous payment
CN106933655A (en) Event execution method and device
WO2023129395A1 (en) Extracting webpage features using coded data packages for page heuristics
US11935100B2 (en) Database management for stored value mediums
CN109583855A (en) Payment funding method, apparatus, computer equipment and storage medium
CN109074552A (en) Knowledge based figure enhances contact card
CN110837596B (en) Intelligent recommendation method and device, computer equipment and storage medium
CN107633422A (en) A kind of market prediction method and device based on user behavior

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant