CN116069857A - Transaction data processing method, system, equipment and medium - Google Patents

Transaction data processing method, system, equipment and medium Download PDF

Info

Publication number
CN116069857A
CN116069857A CN202211707654.9A CN202211707654A CN116069857A CN 116069857 A CN116069857 A CN 116069857A CN 202211707654 A CN202211707654 A CN 202211707654A CN 116069857 A CN116069857 A CN 116069857A
Authority
CN
China
Prior art keywords
transaction
database
transaction data
persistent
request
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.)
Pending
Application number
CN202211707654.9A
Other languages
Chinese (zh)
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.)
Beijing Jiehui Technology Co Ltd
Original Assignee
Beijing Jiehui Technology 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 Beijing Jiehui Technology Co Ltd filed Critical Beijing Jiehui Technology Co Ltd
Priority to CN202211707654.9A priority Critical patent/CN116069857A/en
Publication of CN116069857A publication Critical patent/CN116069857A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the field of data processing, in particular to a transaction data processing method, a transaction data processing system, transaction data processing equipment and a transaction data processing medium, and aims to solve the problem of data delay during data synchronization. To this end, the method of the invention comprises: in response to the orthogonal easy request, storing transaction data in a memory database and a first persistent database, respectively; synchronizing transaction data in the first persistent database to the second persistent database; responding to the anti-transaction request, and judging whether the difference value between the anti-transaction request and the orthogonal easy-request time is smaller than the preset time; according to the judging result, selectively acquiring transaction data from one of the memory database and the first persistence database or acquiring transaction data from the second persistence database; and executing the anti-transaction according to the acquired transaction data, and updating the second persistence database according to the anti-transaction result. Through the implementation mode, the problem of delay in data is solved in a service level, and the use experience of a user is improved.

Description

Transaction data processing method, system, equipment and medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a transaction data processing method, system, device, and medium.
Background
At present, a database OGG technology is needed to be used in the transaction process, so that the data synchronization from a source end to a target end is realized, and the source system and the target system have the same data. After the application system writes into the source library, the target library needs to use the data in time.
In the payment industry, there are both positive transactions (consumption) and negative transactions (refunds), and correspondingly, typically the data of the positive transactions are stored in one database (i.e., the source library) and the data of the negative transactions are stored in the other database (i.e., the target library), which are separate and do not interfere with each other. To effect the anti-transaction, the data in the source library needs to be synchronized to the target library.
The realization principle is that the orthogonal easy-to-apply writing source library is realized by extracting a log file (redog) of the source end, then delivering the log file to the target end through TCP/IP, finally analyzing and restoring the target end, so that the target end realizes the data synchronization of the homologous end, and the anti-transaction reads the data by accessing the target library and performs service logic processing.
Although the OGG technology can capture, transform and deliver a large amount of transaction data, and realize data synchronization of a source database and a target database, there is often a data delay of 6-10 seconds, and in addition, if fields need to be added to the source database and the target database, the OGG needs to be deactivated for a longer time, and this delay is longer, so that user experience is affected.
Accordingly, there is a need in the art for a new solution to the above-mentioned problems.
Disclosure of Invention
The present invention has been made to overcome the above-mentioned drawbacks, and provides a transaction data processing method, system, device and medium that solve or at least partially solve the technical problem of data delay when synchronizing data of a source database and a target database.
In a first aspect, there is provided a transaction data processing method, the method comprising:
in response to the orthogonal easy request, storing transaction data in a memory database and a first persistent database, respectively;
synchronizing transaction data in the first persistent database to a second persistent database;
responding to an anti-transaction request, and judging whether the difference value between the time of the anti-transaction request and the time of the orthogonal easy request is smaller than a preset time;
selectively acquiring the transaction data from one of the memory database and the first persistence database or the second persistence database according to the judging result;
executing anti-transaction according to the acquired transaction data; the method comprises the steps of,
updating the second persistent database according to the result of the anti-transaction.
In one aspect of the transaction data processing method, the selectively acquiring the transaction data from one of the memory database and the first persistent database or the transaction data from the second persistent database according to the determination result includes:
if the difference between the time of the anti-transaction request and the time of the orthogonal easy request is smaller than the preset time, acquiring the transaction data from one of the memory database and the first persistence database;
and/or the number of the groups of groups,
and if the difference value between the time of the anti-transaction request and the time of the orthogonal easy request is not smaller than the preset time, acquiring the transaction data from the second persistence database.
In one aspect of the transaction data processing method, the acquiring the transaction data from one of the memory database and the first persistent database includes:
inquiring the transaction data from the memory database according to the transaction order number;
and if the transaction data is still reserved in the memory database, acquiring the transaction data from the memory database, otherwise, inquiring the transaction data from the first persistence database to acquire the transaction data.
In one aspect of the transaction data processing method, the first persistent database includes a plurality of sub-persistent databases, wherein the plurality of sub-persistent databases are distinguished using different channels;
the storing transaction data in a first persistent database includes: selecting one sub-persistent database from the plurality of sub-persistent databases through Nginx to store the transaction data;
the querying the transaction data from the first persistent database to obtain the transaction data includes:
traversing all sub-persistent databases to obtain channel information;
and obtaining the sub-persistence database in which the transaction data is stored according to the channel information, thereby obtaining the transaction data.
In one aspect of the transaction data processing method, the executing the anti-transaction according to the obtained transaction data includes: and calling a silver-connected or network connection port to execute the anti-transaction.
In one aspect of the transaction data processing method, the updating the second persistent database according to the anti-transaction result includes:
and if the second persistence database has synchronized the transaction data, updating the transaction data in the second persistence database after the response of the Unionpay or the Internet connection port.
In one aspect of the transaction data processing method, the updating the second persistent database according to the anti-transaction result includes:
if the second persistent database still does not synchronize the transaction data, after the response of the banking or networking interface, storing the transaction state and the amount corresponding to the anti-transaction into a temporary table;
and after the second persistence database is detected to synchronize the transaction data, acquiring the transaction state and the amount from the temporary table according to the time and the order number of the anti-transaction request so as to update the transaction data in the second persistence database.
In a second aspect, there is provided a transaction data processing system, the system comprising:
the system comprises an orthogonal easy unit, an anti-transaction unit, an in-memory database, a synchronous component, a first persistence database and a second persistence database, wherein,
in response to an orthogonal easy request, the orthogonal easy unit stores transaction data in the memory database and the first persistent database, respectively;
the synchronization component synchronizes transaction data in the first persistent database to the second persistent database;
responding to an anti-transaction request, and judging whether the difference value between the time of the anti-transaction request and the time of the orthogonal easy request is smaller than a preset time or not by the anti-transaction unit;
according to the judging result, the anti-transaction unit selectively acquires the transaction data from one of the memory database and the first persistence database or acquires the transaction data from the second persistence database;
the anti-transaction unit executes anti-transaction according to the acquired transaction data; the method comprises the steps of,
the anti-transaction unit updates the second persistent database according to the result of the anti-transaction.
In one aspect of the transaction data processing system described above, the system further comprises a gateway, wherein,
if the difference between the time of the anti-transaction request and the time of the orthogonal easy request is smaller than the preset time, the anti-transaction unit accesses the gateway;
the gateway inquires the transaction data from the memory database according to the transaction order number;
and if the transaction data is still reserved in the memory database, the gateway acquires the transaction data from the memory database and returns the transaction data to the anti-transaction unit, otherwise, the gateway inquires the transaction data from the first persistence database to acquire the transaction data and returns the transaction data to the anti-transaction unit.
In one aspect of the transaction data processing system, the system further includes nginnx;
the first persistent database comprises a plurality of sub-persistent databases, wherein the plurality of sub-persistent databases are distinguished using different corridors;
in response to an orthogonal easy request, the nmginx selects one sub-persistent database from the plurality of sub-persistent databases to store the transaction data;
the gateway traverses all sub-persistence databases to obtain channel information;
and the gateway obtains the sub-persistence database in which the transaction data is stored according to the channel information, thereby obtaining the transaction data.
In a third aspect, an electronic device is provided, the electronic device comprising a processor and a storage device, the storage device being adapted to store a plurality of program codes, the program codes being adapted to be loaded and run by the processor to perform the transaction data processing method according to any one of the above-mentioned aspects of the transaction data processing method.
In a fourth aspect, a computer readable storage medium is provided, in which a plurality of program codes are stored, the program codes being adapted to be loaded and run by a processor to perform the transaction data processing method according to any one of the above-mentioned aspects of the transaction data processing method.
One or more of the above technical solutions of the present invention at least has one or more of the following
The beneficial effects are that:
in the technical scheme of implementing the invention, transaction data are respectively stored in a memory database and a first persistence database in response to an orthogonal easy request; synchronizing transaction data in the first persistent database to the second persistent database; responding to the anti-transaction request, and judging whether the difference value between the time of the anti-transaction request and the time of the orthogonal easy request is smaller than the preset time; according to the judging result, selectively acquiring transaction data from one of the memory database and the first persistence database or acquiring transaction data from the second persistence database; and executing the anti-transaction according to the acquired transaction data, and updating the second persistence database according to the anti-transaction result. By the implementation mode, transaction data can be processed in real time between databases, and the problem of delay in data is solved at a business level, so that business influence caused by data delay is avoided, and use experience of a user is improved.
Drawings
The present disclosure will become more readily understood with reference to the accompanying drawings. As will be readily appreciated by those skilled in the art: the drawings are for illustrative purposes only and are not intended to limit the scope of the present invention. Moreover, like numerals in the figures are used to designate like parts, wherein:
FIG. 1 is a block diagram of the main architecture of a transaction data processing system according to one embodiment of the invention;
FIG. 2 is a flow chart illustrating the main steps of a transaction data processing method according to one embodiment of the present invention;
fig. 3 is a schematic diagram of the main structure of an embodiment of an electronic device according to the present invention.
List of reference numerals:
101: an orthogonal easy unit; 102: an anti-transaction unit; 103: a memory database; 104: a synchronization component; 105: a first persistent database; 106: a second persistent database; 107: a gateway; 108: nginx;301: a processor; 302: a storage device.
Detailed Description
Some embodiments of the invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are merely for explaining the technical principles of the present invention, and are not intended to limit the scope of the present invention.
In the description of the present invention, a "module," "processor" may include hardware, software, or a combination of both. A module may comprise hardware circuitry, various suitable sensors, communication ports, memory, or software components, such as program code, or a combination of software and hardware. The processor may be a central processor, a microprocessor, an image processor, a digital signal processor, or any other suitable processor. The processor has data and/or signal processing functions. The processor may be implemented in software, hardware, or a combination of both. Non-transitory computer readable storage media include any suitable medium that can store program code, such as magnetic disks, hard disks, optical disks, flash memory, read-only memory, random access memory, and the like. The term "a and/or B" means all possible combinations of a and B, such as a alone, B alone or a and B. The term "at least one A or B" or "at least one of A and B" has a meaning similar to "A and/or B" and may include A alone, B alone or A and B. The singular forms "a", "an" and "the" include plural referents.
Some terms related to the present invention will be explained first.
Nginx: i.e., enginex, is an open source supporting high performance, high concurrency Web services and proxy service software.
OGG: oracle GoldenGate is a log-based structured data replication backup software that synchronizes a source database with a target database by parsing an online log or archive log of the source database to obtain incremental changes in the data and then applying those changes to the target database.
API: the application program interface, i.e. a call interface that the operating system leaves to the application program, and the application program makes the operating system execute the command of the application program by calling the API of the operating system.
Redis: the remote dictionary server is an open source log-type and Key-Value database which is written and supported by ANSIC language, can be based on memory and can be persistent, and provides multiple language APIs.
Batch running: the method has the characteristics of large data volume, automation and high performance, wherein the large data volume refers to the fact that batch tasks are generally accompanied by large data processing; automation is automatic operation requiring a set time or frequency; high performance is a requirement that batch processing tasks be completed in a specified time.
At present, a database OGG technology is needed to be used in the transaction process, so that the data synchronization from a source end to a target end is realized, and the source system and the target system have the same data. Although the OGG technology can capture, transform and deliver a large amount of transaction data, and realize data synchronization of a source database and a target database, there is often a data delay of 6-10 seconds, and in addition, if fields need to be added to the source database and the target database, the OGG needs to be deactivated for a longer time, and this delay is longer, so that user experience is affected. In order to solve the problem of data delay when the data of the source database and the target database are synchronized, the invention provides a transaction data processing method, a transaction data processing system, transaction data processing equipment and a transaction data processing medium.
Referring now to FIG. 1, FIG. 1 is a block diagram of the primary architecture of a transaction data processing system in accordance with one embodiment of the present invention. As shown in fig. 1, the transaction data processing system in the embodiment of the present invention mainly includes an orthogonal easy unit 101, an anti-transaction unit 102, an in-memory database 103, a synchronization component 104, a first persistent database 105, a second persistent database 106, a gateway 107, and an Nginx108.
In some embodiments, the orthogonal easy unit 101, the anti-transaction unit 102, the in-memory database 103, the synchronization component 104, the first persistent database 105, the second persistent database 106, the gateway 107, and the nminbx 108 may be software functional modules in one software system.
In other embodiments, such as in a distributed system, the orthogonal easy unit 101, the anti-transaction unit 102, the in-memory database 103, the synchronization component 104, the first persistent database 105, the second persistent database 106, the gateway 107, and the nmginx 108 may be micro-services deployed on different servers, respectively.
Referring to fig. 2, fig. 2 is a schematic flow chart of main steps of a transaction data processing method according to an embodiment of the present invention. As shown in fig. 2, the transaction data processing method in the embodiment of the invention mainly includes the following steps S201 to S206.
Step S201: transaction data is stored in the in-memory database and the first persistent database, respectively, in response to the orthogonal easy request.
Step S202: the transaction data in the first persistent database is synchronized to the second persistent database.
Step S203: in response to the anti-transaction request, it is determined whether a difference between the time of the anti-transaction request and the time of the orthogonal easy request is less than a preset time.
Step S204: and selectively acquiring transaction data from one of the memory database and the first persistence database or acquiring transaction data from the second persistence database according to the judging result.
Step S205: and executing the anti-transaction according to the acquired transaction data.
Step S206: and updating the second persistence database according to the result of the anti-transaction.
Based on the method described in the above steps S201 to S206, by setting the memory database and querying the memory database or the first persistent database (source database) under the condition that the preset condition is satisfied, instead of directly querying the second persistent database (target database), the transaction data can be processed in real time between databases, so that the problem of delay in data is solved at the service level (due to technical reasons, for example, the problem of delay in data of 6-10 seconds in OGG in the background technology, or due to technical requirements (for example, the problem that fields need to be added to the source database and the target database mentioned in the background technology), the synchronization component needs to be deactivated for a longer time, so that the data cannot be synchronized from the source database to the target database), thereby avoiding the service influence caused by data delay and improving the use experience of users.
The following further describes the steps S201 to S206.
In one example of step S201 described above, the orthogonal easy unit 101 shown in fig. 1 stores transaction data in the in-memory database 103 and the first persistent database 105, respectively, in response to the orthogonal easy request. Wherein, the memory database 103 may be Redis; the transaction is payment and the first persistent database 105 is the source database.
For example, the user pays in a mall by scanning codes, and the cashier end of the mall calls the positive transaction API to write transaction data into the Redis and the source end library respectively. Wherein the transaction data includes aggregate data, i.e., transaction time, transaction amount, transaction order number, etc.
In another example, the first persistent database includes a plurality of sub-persistent databases, wherein the plurality of sub-persistent databases are distinguished using different aisles.
For example, channel 1 corresponds to sub-persistence database 1; the channel 2 corresponds to the sub-persistent database 2, etc., and the channel is used for transmitting data to the corresponding database. Thus, the first persistent database at this time also includes the shaft information.
Further, in one particular embodiment, storing transaction data in a first persistent database includes:
transaction data is stored by selecting one sub-persistent database from the plurality of sub-persistent databases through Nginx.
For example, the transaction data may be stored by randomly selecting one of the sub-persistent databases, or alternatively selecting one of the sub-persistent databases, without limitation.
The above is a further explanation of step S201, and the following further explanation of step S202 is continued.
In one example of step S202 described above, the transaction data in the first persistent database 105 may be synchronized to the second persistent database 106 by the synchronization component 104 shown in fig. 1. The synchronization component 104 may be an OGG, the first persistent database 105 is a source database, and the second persistent database 106 is a target database.
For example, after a user pays for a mall code, the source library synchronizes transaction data to the target library via the OGG.
The above is a further explanation of step S202, and the following further explanation of step S203 is continued.
In one example of the above step S203, the anti-transaction unit 102 shown in fig. 1 determines whether the difference between the time of the anti-transaction request and the time of the orthogonal easy request is less than the preset time in response to the anti-transaction request. Wherein the anti-transaction is refund.
For example, the cashier end of the mall initiates an anti-transaction request to the anti-transaction API, the anti-transaction unit 102 determines whether the difference between the time of the anti-transaction request and the time of the orthogonal easy request is less than a preset time, such as two days, where the setting of two days is to fully consider that, for example, the source library and the target library mentioned in the background art need to be added with fields, so that the synchronization component needs to be deactivated for a longer time (in practice, the work of adding fields to the source library and the target library can be completed in two days generally), and those skilled in the art can set the preset time in a specific scenario according to the actual situation, which is not limited herein.
The above is a further explanation of step S203, and the following further explanation of step S204 is continued.
In one example of the above step S204, if the difference between the time of the anti-transaction request and the time of the orthogonal easy request is less than the preset time, the transaction data is obtained from one of the memory database 103 and the first persistent database 105 shown in fig. 1.
Specifically, the method comprises the following steps:
inquiring transaction data from the memory database 103 according to the transaction order number;
if transaction data is still retained in the memory database 103, the transaction data is obtained from the memory database 103, otherwise, the transaction data is queried from the first persistent database 105 to obtain the transaction data.
For example, the gateway searches for the Redis according to the original transaction order number, if the transaction information is stored in the Redis, the Redis returns to the anti-transaction unit through the gateway, the anti-transaction unit continues to access the UnionPay or Internet connection port after receiving the transaction information, and requests refund. However, since the Redis memory database can clear data in a certain time, if the inquiry fails, the inquiry is performed from the source terminal library, and the inquiry is returned to the anti-transaction unit through the gateway, the anti-transaction unit continues to access the UnionPay or Internet connection port after receiving the flow, and a refund is requested.
Further, since the first persistent database includes a plurality of sub-persistent databases, in one particular embodiment, querying transaction data from the first persistent database to obtain transaction data includes:
traversing all sub-persistent databases to obtain channel information;
and obtaining sub-persistence databases in which transaction data are stored according to the channel information, thereby obtaining the transaction data.
For example, in the case where the source stock stores transaction data in a plurality of sub-databases, the source stock stores transaction data by selecting one sub-database through nginnx. When transaction data is acquired, if query fails, channel information is acquired from source end libraries, namely all source end libraries are traversed to acquire channel information, and then transaction data is acquired from corresponding sub-databases, for example, the transaction data is transmitted to the corresponding sub-databases 2 based on the channel 2, and then the transaction data is acquired from the sub-databases 2.
In another example of the above step S204, if the difference between the time of the anti-transaction request and the time of the orthogonal easy request is not less than the preset time, the transaction data is obtained from the second persistent database 106 shown in fig. 1
Namely, the anti-transaction unit directly inquires and acquires transaction data based on OGG synchronization in the second persistence database.
The above is a further explanation of step S204, and the following further explanation of step S205 is continued.
In one example of the above step S205, performing the anti-transaction according to the acquired transaction data includes:
and calling a silver-connected or network connection port to execute the anti-transaction.
For example, the anti-transaction unit 102 shown in fig. 1 accesses a banking or networking interface and performs an anti-transaction request refund upon receipt of transaction data.
The above is a further explanation of step S205, and the following further explanation of step S206 is continued.
In one example of step S206 described above, if the second persistent database has synchronized transaction data, the transaction data in the second persistent database is updated after the silver-wire or network-wire interface replies.
In another example, if the second persistent database is not synchronizing transaction data, after the response of the banking or networking interface, the transaction status and amount corresponding to the anti-transaction are stored in the temporary table.
For example, when a refund is requested within 6 seconds as described in the background art, after a response from the Union or Union, the transaction status and the amount are returned to the anti-transaction unit, which stores the transaction status and the transaction amount information in the temporary table. Wherein the transaction status includes refund, revoked, etc.
Further, after detecting that the second persistent database synchronizes the transaction data, the transaction state and the amount are obtained from the temporary table according to the time of the anti-transaction request and the order number, so as to update the transaction data in the second persistent database.
For example, the transaction data is stored in the running batch system in the anti-transaction process, and after the target terminal library is detected to be synchronous with the transaction data, the running batch system acquires the transaction state and the amount information from the temporary table according to the time and the order number, and updates the data of the target terminal library.
The above is a further explanation of step S206.
It should be noted that, although the foregoing embodiments describe the steps in a specific order, it will be understood by those skilled in the art that, in order to achieve the effects of the present invention, the steps are not necessarily performed in such an order, and may be performed simultaneously (in parallel) or in other orders, and these variations are within the scope of the present invention.
Further, referring to fig. 1, the invention also provides a transaction data processing system.
As shown in FIG. 1, in one embodiment, the transaction data processing system generally includes an orthogonal easy unit 101, an anti-transaction unit 102, an in-memory database 103, a synchronization component 104, a first persistent database 105, and a second persistent database 106.
Wherein, in response to the orthogonal easy request, orthogonal easy unit 101 stores transaction data in memory database 103 and first persistent database 105, respectively;
the synchronization component 104 synchronizes the transaction data in the first persistent database 105 to the second persistent database 106;
in response to the anti-transaction request, the anti-transaction unit 102 determines whether a difference between the time of the anti-transaction request and the time of the orthogonal easy request is less than a preset time;
based on the determination result, the anti-transaction unit 102 selectively acquires transaction data from one of the memory database 103 and the first persistent database 105, or acquires transaction data from the second persistent database 106;
the anti-transaction unit 102 performs an anti-transaction according to the acquired transaction data; and, the anti-transaction unit 102 updates the second persistent database 106 according to the result of the anti-transaction.
In one embodiment, the transaction data processing system further includes a gateway 107.
If the difference between the time of the anti-transaction request and the time of the orthogonal easy request is less than the preset time, the anti-transaction unit 102 accesses the gateway 107;
gateway 107 queries the transaction data from memory database 103 based on the transaction order number;
if transaction data is still retained in the memory database 103, the gateway 107 obtains transaction data from the memory database 103 and returns the transaction data to the anti-transaction unit 102, otherwise, the gateway 107 queries the transaction data from the first persistent database 105 to obtain transaction data and returns the transaction data to the anti-transaction unit 102.
In one embodiment, the transaction data processing system further includes an Nginx108.
The first persistent database 105 includes a plurality of sub-persistent databases, wherein the plurality of sub-persistent databases are distinguished using different aisles;
in response to the orthogonal easy request, the nmginx 108 selects one sub-persistent database from the plurality of sub-persistent databases to store transaction data;
the gateway 107 traverses all sub-persistent databases to obtain channel information;
the gateway 107 obtains transaction data from the channel information from the sub-persistent database in which the transaction data is stored.
The foregoing transaction data processing system is used for executing the embodiment of the transaction data processing method shown in fig. 2, and the technical principles of the two, the technical problems to be solved and the technical effects to be produced are similar, and those skilled in the art can clearly understand that, for convenience and brevity of description, the specific working process and the related description of the transaction data processing system may refer to the description of the embodiment of the transaction data processing method, and will not be repeated herein.
It will be appreciated by those skilled in the art that the present invention may implement all or part of the above-described methods according to the above-described embodiments, or may be implemented by means of a computer program for instructing relevant hardware, where the computer program may be stored in a computer readable storage medium, and where the computer program may implement the steps of the above-described embodiments of the method when executed by a processor. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable storage medium may include: any entity or device, medium, usb disk, removable hard disk, magnetic disk, optical disk, computer memory, read-only memory, random access memory, electrical carrier wave signals, telecommunications signals, software distribution media, and the like capable of carrying the computer program code.
The invention further provides electronic equipment. Referring to fig. 3, fig. 3 is a schematic diagram of the main structure of an embodiment of an electronic device according to the present invention. As shown in fig. 3, the electronic device in the embodiment of the present invention mainly includes a processor 301 and a storage device 302, and the storage device 302 may be configured to store a program for executing the transaction data processing method of the above-described method embodiment, and the processor 301 may be configured to execute the program in the storage device 302, including, but not limited to, the program for executing the transaction data processing method of the above-described method embodiment. For convenience of explanation, only those portions of the embodiments of the present invention that are relevant to the embodiments of the present invention are shown, and specific technical details are not disclosed, please refer to the method portions of the embodiments of the present invention.
In some possible embodiments of the invention, the electronic device may comprise a plurality of processors 301 and a plurality of storage means 302. While the program for performing the transaction data processing of the above-described method embodiments may be divided into a plurality of sub-programs, each of which may be loaded and executed by the processor 301 to perform the different steps of the transaction data processing method of the above-described method embodiments, respectively. Specifically, each of the subroutines may be stored in different storage devices 302, respectively, and each of the processors 301 may be configured to execute the programs in one or more storage devices 302 to collectively implement the transaction data processing method of the above method embodiment, that is, each of the processors 301 executes different steps of the transaction data processing method of the above method embodiment, respectively, to collectively implement the transaction data processing method of the above method embodiment.
The plurality of processors 301 may be processors disposed on the same device, for example, the electronic device may be a high-performance device composed of a plurality of processors, and the plurality of processors 301 may be processors configured on the high-performance device. In addition, the plurality of processors 301 may be processors disposed on different devices, for example, the electronic device may be a server cluster, and the plurality of processors 301 may be processors on different servers in the server cluster.
Further, the invention also provides a computer readable storage medium. In one computer-readable storage medium embodiment according to the present invention, the computer-readable storage medium may be configured to store a program for executing the transaction data processing method of the above-described method embodiment, which program may be loaded and executed by a processor to implement the above-described transaction data processing method. For convenience of explanation, only those portions of the embodiments of the present invention that are relevant to the embodiments of the present invention are shown, and specific technical details are not disclosed, please refer to the method portions of the embodiments of the present invention. The computer readable storage medium may be a storage device including various electronic devices, and optionally, the computer readable storage medium in the embodiments of the present invention is a non-transitory computer readable storage medium.
Thus far, the technical solution of the present invention has been described in connection with one embodiment shown in the drawings, but it is easily understood by those skilled in the art that the scope of protection of the present invention is not limited to these specific embodiments. Equivalent modifications and substitutions for related technical features may be made by those skilled in the art without departing from the principles of the present invention, and such modifications and substitutions will fall within the scope of the present invention.

Claims (12)

1. A transaction data processing method, the method comprising:
in response to the orthogonal easy request, storing transaction data in a memory database and a first persistent database, respectively;
synchronizing transaction data in the first persistent database to a second persistent database;
responding to an anti-transaction request, and judging whether the difference value between the time of the anti-transaction request and the time of the orthogonal easy request is smaller than a preset time;
selectively acquiring the transaction data from one of the memory database and the first persistence database or the second persistence database according to the judging result;
executing anti-transaction according to the acquired transaction data; the method comprises the steps of,
updating the second persistent database according to the result of the anti-transaction.
2. The method of claim 1, wherein selectively retrieving the transaction data from one of the memory database and the first persistent database or retrieving the transaction data from the second persistent database based on the determination comprises:
if the difference between the time of the anti-transaction request and the time of the orthogonal easy request is smaller than the preset time, acquiring the transaction data from one of the memory database and the first persistence database;
and/or the number of the groups of groups,
and if the difference value between the time of the anti-transaction request and the time of the orthogonal easy request is not smaller than the preset time, acquiring the transaction data from the second persistence database.
3. The method of claim 2, wherein the retrieving the transaction data from one of the in-memory database and the first persistent database comprises:
inquiring the transaction data from the memory database according to the transaction order number;
and if the transaction data is still reserved in the memory database, acquiring the transaction data from the memory database, otherwise, inquiring the transaction data from the first persistence database to acquire the transaction data.
4. A method according to claim 3, wherein the first persistent database comprises a plurality of sub-persistent databases, wherein the plurality of sub-persistent databases are distinguished using different corridors;
the storing transaction data in a first persistent database includes: selecting one sub-persistent database from the plurality of sub-persistent databases through Nginx to store the transaction data;
the querying the transaction data from the first persistent database to obtain the transaction data includes:
traversing all sub-persistent databases to obtain channel information;
and obtaining the sub-persistence database in which the transaction data is stored according to the channel information, thereby obtaining the transaction data.
5. The method of claim 1, wherein said executing an anti-transaction based on said acquired transaction data comprises: and calling a silver-connected or network connection port to execute the anti-transaction.
6. The method of claim 5, wherein said updating said second persistent database based on the result of said anti-transaction comprises:
and if the second persistence database has synchronized the transaction data, updating the transaction data in the second persistence database after the response of the Unionpay or the Internet connection port.
7. The method of claim 5, wherein said updating said second persistent database based on the result of said anti-transaction comprises:
if the second persistent database still does not synchronize the transaction data, after the response of the banking or networking interface, storing the transaction state and the amount corresponding to the anti-transaction into a temporary table;
and after the second persistence database is detected to synchronize the transaction data, acquiring the transaction state and the amount from the temporary table according to the time and the order number of the anti-transaction request so as to update the transaction data in the second persistence database.
8. A transaction data processing system, the system comprising:
the system comprises an orthogonal easy unit, an anti-transaction unit, an in-memory database, a synchronous component, a first persistence database and a second persistence database, wherein,
in response to an orthogonal easy request, the orthogonal easy unit stores transaction data in the memory database and the first persistent database, respectively;
the synchronization component synchronizes transaction data in the first persistent database to the second persistent database;
responding to an anti-transaction request, and judging whether the difference value between the time of the anti-transaction request and the time of the orthogonal easy request is smaller than a preset time or not by the anti-transaction unit;
according to the judging result, the anti-transaction unit selectively acquires the transaction data from one of the memory database and the first persistence database or acquires the transaction data from the second persistence database;
the anti-transaction unit executes anti-transaction according to the acquired transaction data; the method comprises the steps of,
the anti-transaction unit updates the second persistent database according to the result of the anti-transaction.
9. The system of claim 8, further comprising a gateway, wherein,
if the difference between the time of the anti-transaction request and the time of the orthogonal easy request is smaller than the preset time, the anti-transaction unit accesses the gateway;
the gateway inquires the transaction data from the memory database according to the transaction order number;
and if the transaction data is still reserved in the memory database, the gateway acquires the transaction data from the memory database and returns the transaction data to the anti-transaction unit, otherwise, the gateway inquires the transaction data from the first persistence database to acquire the transaction data and returns the transaction data to the anti-transaction unit.
10. The system of claim 9, wherein the system further comprises nginnx;
the first persistent database comprises a plurality of sub-persistent databases, wherein the plurality of sub-persistent databases are distinguished using different corridors;
in response to an orthogonal easy request, the nmginx selects one sub-persistent database from the plurality of sub-persistent databases to store the transaction data;
the gateway traverses all sub-persistence databases to obtain channel information;
and the gateway obtains the sub-persistence database in which the transaction data is stored according to the channel information, thereby obtaining the transaction data.
11. An electronic device comprising a processor and a storage means, the storage means being adapted to store a plurality of program code, characterized in that the program code is adapted to be loaded and executed by the processor to perform the method of any one of claims 1 to 7.
12. A computer readable storage medium, in which a plurality of program codes are stored, characterized in that the program codes are adapted to be loaded and run by a processor to perform the method of any one of claims 1 to 7.
CN202211707654.9A 2022-12-29 2022-12-29 Transaction data processing method, system, equipment and medium Pending CN116069857A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211707654.9A CN116069857A (en) 2022-12-29 2022-12-29 Transaction data processing method, system, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211707654.9A CN116069857A (en) 2022-12-29 2022-12-29 Transaction data processing method, system, equipment and medium

Publications (1)

Publication Number Publication Date
CN116069857A true CN116069857A (en) 2023-05-05

Family

ID=86172621

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211707654.9A Pending CN116069857A (en) 2022-12-29 2022-12-29 Transaction data processing method, system, equipment and medium

Country Status (1)

Country Link
CN (1) CN116069857A (en)

Similar Documents

Publication Publication Date Title
US8412690B2 (en) In-memory processing for a data warehouse
US7634512B2 (en) Migrating temporary data of a session
US9792307B2 (en) Enterprise-based searching of new and updated data
CN110019469B (en) Distributed database data processing method and device, storage medium and electronic device
US11151081B1 (en) Data tiering service with cold tier indexing
JP2012234333A (en) Cluster system, synchronization control method, server device and synchronization control program
KR20210040864A (en) File directory traversal method, apparatus, device, and medium
CN109165078B (en) Virtual distributed server and access method thereof
CN114006946B (en) Method, device, equipment and storage medium for processing homogeneous resource request
JP3290801B2 (en) Resource location detection method
CN112948025A (en) Data loading method and device, storage medium, computing equipment and computing system
US10979303B1 (en) Segmentation of maintenance on distributed systems
CN113094431A (en) Read-write separation method and device and server
CN112596956A (en) File system management method, device and related components
CN116069857A (en) Transaction data processing method, system, equipment and medium
CN105978744A (en) Resource allocation method, device and system
CN111680069B (en) Database access method and device
US8650548B2 (en) Method to derive software use and software data object use characteristics by analyzing attributes of related files
US11360866B2 (en) Updating stateful system in server cluster
CN111240810B (en) Transaction management method, device, equipment and storage medium
CN109635040B (en) Real-time data migration method and device and storage medium
CN111343258A (en) Peer node management method, device, storage medium and electronic equipment
US11669535B1 (en) Maintaining at a target database system a copy of a source table of a source database system
US11520767B2 (en) Automated database cache resizing
CN114595069B (en) Service offline method and device, electronic equipment and storage medium

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