CN112767159B - Online transaction processing method and device - Google Patents

Online transaction processing method and device Download PDF

Info

Publication number
CN112767159B
CN112767159B CN202110079935.3A CN202110079935A CN112767159B CN 112767159 B CN112767159 B CN 112767159B CN 202110079935 A CN202110079935 A CN 202110079935A CN 112767159 B CN112767159 B CN 112767159B
Authority
CN
China
Prior art keywords
transaction
level
memory
database
online transaction
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.)
Active
Application number
CN202110079935.3A
Other languages
Chinese (zh)
Other versions
CN112767159A (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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110079935.3A priority Critical patent/CN112767159B/en
Publication of CN112767159A publication Critical patent/CN112767159A/en
Application granted granted Critical
Publication of CN112767159B publication Critical patent/CN112767159B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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

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

Abstract

The invention provides an online transaction processing method and device, which can be used in the financial field or other technical fields. The method comprises the following steps: receiving an online transaction request and writing the online transaction request into a memory queue; acquiring transaction flow parameters based on the online transaction requests in the memory queue; and if the transaction flow parameters do not meet the memory-level transaction execution rules, sending a first switching instruction to the middle-background application system so that the middle-background application system is switched from the memory-level asynchronous processing mechanism to the database-level asynchronous processing mechanism. The device is used for executing the method. The online transaction processing method and device provided by the embodiment of the invention ensure the stability of online transaction processing of the middle and background application system.

Description

Online transaction processing method and device
Technical Field
The invention relates to the technical field of computers, in particular to an online transaction processing method and device.
Background
With the popularization of the internet, customers can transact financial services online through internet banking, mobile phone banking and other modes.
In order to realize online transaction of financial services, an interaction scene between a middle background application system (hereinafter referred to as a middle background application system) of a banking financial service and a front background application system (hereinafter referred to as a front background application system) of each partner company is rapidly increased, and because transaction flows of the front background application system and the middle background application system are different, the middle background application system can face transaction flow impact during a peak period of an online service after being in butt joint with the front background application system, in order to enable the middle background application system to stably process transaction requests when facing the impact of the transaction flow, a database-level asynchronous framework is often configured for the middle background application system so as to ensure high availability of the middle background application system when facing the online service peak period. However, according to the online practice of a large number of service systems, most of the transaction amount of the online systems does not reach the transaction flow preset in the initial stage of system construction, so that the utilization rate of the middle and background application systems is often insufficient after the application systems fall to the asynchronous framework of the database level, and the system resources are wasted.
Disclosure of Invention
Aiming at the problems in the prior art, the embodiment of the invention provides an online transaction processing method and device, which can at least partially solve the problems in the prior art.
In one aspect, the present invention provides an online transaction processing method, including:
receiving an online transaction request and writing the online transaction request into a memory queue;
acquiring transaction flow parameters based on the online transaction requests in the memory queue;
and if the transaction flow parameters do not meet the memory-level transaction execution rules, sending a first switching instruction to the middle-background application system so that the middle-background application system is switched from the memory-level asynchronous processing mechanism to the database-level asynchronous processing mechanism.
In another aspect, the present invention provides an online transaction processing apparatus comprising:
the receiving unit is used for receiving the online transaction request and writing the online transaction request into the memory queue;
the obtaining unit is used for obtaining transaction flow parameters based on the online transaction requests in the memory queue;
and the first switching unit is used for sending a first switching instruction to the middle-background application system after the transaction flow parameter does not meet the memory-level transaction execution rule so that the middle-background application system is switched from the memory-level asynchronous processing mechanism to the database-level asynchronous processing mechanism.
In yet another aspect, the present invention provides an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the online transaction processing method of any of the embodiments described above when the program is executed.
In yet another aspect, the present invention provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the online transaction processing method of any of the embodiments described above.
The online transaction processing method and the online transaction processing device provided by the embodiment of the invention can receive the online transaction request and write the online transaction request into the memory queue, acquire the transaction flow parameter based on the online transaction request in the memory queue, and send the first switching instruction to the middle-background application system after the transaction flow parameter does not meet the memory-level transaction execution rule so that the middle-background application system is switched to the database-level asynchronous processing mechanism from the memory-level asynchronous processing mechanism, thereby avoiding the impact of the online transaction request on the middle-background application system during service peaks and ensuring the online transaction processing stability of the middle-background application system.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art. In the drawings:
FIG. 1 is a schematic diagram of an online transaction processing system according to an embodiment of the invention.
Fig. 2 is a flowchart of an online transaction processing method according to an embodiment of the invention.
Fig. 3 is a flowchart of an online transaction processing method according to another embodiment of the invention.
Fig. 4 is a flowchart of an online transaction processing method according to another embodiment of the invention.
Fig. 5 is a schematic structural diagram of an online transaction processing device according to an embodiment of the invention.
Fig. 6 is a schematic structural diagram of an online transaction processing device according to another embodiment of the invention.
Fig. 7 is a schematic physical structure of an electronic device according to an embodiment of the invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention will be described in further detail with reference to the accompanying drawings. The exemplary embodiments of the present invention and their descriptions herein are for the purpose of explaining the present invention, but are not to be construed as limiting the invention. It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be arbitrarily combined with each other.
Fig. 1 is a schematic structural diagram of an online transaction processing system according to an embodiment of the present invention, and as shown in fig. 1, the online transaction processing system according to an embodiment of the present invention includes a foreground application system 1, a switching server 2, and a middle-background application system 3, wherein:
the foreground application 1 comprises at least one foreground terminal 11 and the background application 3 comprises at least one application server 31. The switching server 2 is communicatively connected to each of the foreground terminals 31, and the switching server 2 is communicatively connected to each of the application servers 31. The front-end terminal 11 includes, but is not limited to, a desktop computer, a notebook computer, a server, and the like.
Each foreground terminal 11 may send an online transaction request to the switching server 2, where the switching server 2 executes the online transaction processing method provided in the embodiment of the present invention. The mid-background application system 3 switches between the memory-level asynchronous processing mechanism and the database-level asynchronous processing mechanism according to the first switching instruction or the second switching instruction sent by the switching server 2. Wherein the memory-level asynchronous processing mechanism and the database-level asynchronous processing mechanism are preconfigured to the mid-background application system 3.
The memory-level asynchronous processing mechanism refers to that the application server 31 in the background application system 3 directly writes the received online transaction request into the memory, and then performs corresponding processing. The online transaction requests are processed by adopting a memory-level asynchronous processing mechanism, so that the risk of memory overflow exists, if the processing time of a certain online transaction request is too long, the subsequent online transaction requests are always written into the memory, and after the number of the online transaction requests is accumulated to a certain number, the memory overflow is caused. Therefore, the online transaction processing method provided by the embodiment of the invention limits the online transaction request through the memory-level transaction execution rule so as to avoid memory overflow.
The database-level asynchronous processing mechanism refers to that in the background application system 3, the application server 31 writes the received online transaction request into the database first, and when the memory is idle, the online transaction request is obtained from the database for processing. For some online transaction requests, such as online transaction requests for purchasing financial products or online transaction requests for purchasing goods, the online transaction requests should not be denied, and if the application server 31 of the background application system 3 is full and cannot receive new online transaction requests, the online transaction requests can be processed through a database-level asynchronous processing mechanism.
Fig. 2 is a flowchart of an online transaction processing method according to an embodiment of the present invention, and as shown in fig. 2, the online transaction processing method according to an embodiment of the present invention includes:
s201, receiving an online transaction request and writing the online transaction request into a memory queue;
specifically, the foreground terminal of the foreground application system sends an online transaction request to a switching server, and the switching server receives each online transaction request and then writes each online transaction request into a memory queue one by one. Wherein the online transaction request includes, but is not limited to, a financial purchase request, an online banking login request, a balance inquiry request, a transfer request, a payment request, and the like.
S202, acquiring transaction flow parameters based on the online transaction requests in the memory queue;
specifically, after writing the online transaction request into a memory queue, the switching server obtains a transaction flow parameter based on the online transaction request in the memory queue. The transaction flow parameters include, but are not limited to, an average number of online transaction requests, an average transaction amount per unit time, and an average response time, which are set according to actual needs, and the embodiment of the invention is not limited.
And S203, if the transaction flow parameter does not meet the memory-level transaction execution rule, a first switching instruction is sent to the middle-background application system so that the middle-background application system is switched from the memory-level asynchronous processing mechanism to the database-level asynchronous processing mechanism.
Specifically, after obtaining the transaction flow parameter, the switching server determines whether the transaction flow parameter meets a memory level transaction execution rule, and if the transaction flow parameter meets the memory level transaction execution rule, the switching server sends an online transaction request to an application server of the middle-background application system for processing. If the transaction flow parameters do not meet the memory level transaction execution rules, the switching server sends a first switching instruction to the mid-background application system so that the mid-background application system is switched from a memory level asynchronous processing mechanism to a database level asynchronous processing mechanism. The memory level transaction execution rule is preset and set according to actual needs, and the embodiment of the invention is not limited. The first switching instruction is preset and set according to actual needs, and the embodiment of the invention is not limited. The memory level asynchronous processing mechanism and the database level asynchronous processing mechanism are preconfigured to the middle-background application system.
For example, if the transaction flow parameter includes a parameter a, the memory level transaction execution rule includes a memory level transaction execution condition corresponding to the parameter a, and if the parameter a does not satisfy the corresponding memory level transaction execution condition, the transaction flow parameter does not satisfy the memory level transaction execution rule. If the parameter A meets the corresponding memory level transaction execution condition, the transaction flow parameter meets the memory level transaction execution rule.
For example, transaction flow parameters include two parameters: and the memory level transaction execution rule comprises memory level transaction execution conditions corresponding to the parameter B and memory level transaction execution conditions corresponding to the parameter C. If the parameter B does not meet the corresponding memory level transaction execution condition or the parameter C does not meet the corresponding memory level transaction execution condition, the transaction flow parameter does not meet the memory level transaction execution rule. If the parameter B meets the corresponding memory level transaction execution condition and the parameter C meets the corresponding memory level transaction execution condition, the transaction flow parameter meets the memory level transaction execution rule.
For example, transaction flow parameters include three parameters: the memory level transaction execution rule comprises memory level transaction execution conditions corresponding to the parameter D, memory level transaction execution conditions corresponding to the parameter E and memory level transaction execution conditions corresponding to the parameter F. If any one of the parameters D, E and F does not meet the corresponding memory level transaction execution condition, the transaction flow parameter does not meet the memory level transaction execution rule. If the parameters D, E and F meet the corresponding memory-level transaction execution conditions, respectively, the transaction flow parameters meet the memory-level transaction execution rules.
The online transaction processing method provided by the embodiment of the invention can receive the online transaction request and write the online transaction request into the memory queue, acquire the transaction flow parameter based on the online transaction request in the memory queue, and send the first switching instruction to the middle-background application system after the transaction flow parameter does not meet the memory-level transaction execution rule so that the middle-background application system is switched from the memory-level asynchronous processing mechanism to the database-level asynchronous processing mechanism, thereby avoiding the impact of the online transaction request on the middle-background application system during service peaks and ensuring the online transaction processing stability of the middle-background application system.
Fig. 3 is a flow chart of an online transaction processing method according to another embodiment of the present invention, as shown in fig. 3, further, based on the above embodiments, the online transaction processing method according to the embodiment of the present invention further includes:
s301, periodically acquiring transaction flow parameters from a flow record table of a database of the middle background application system;
specifically, after receiving the first switching instruction, the middle-background application system switches to a database-level asynchronous processing mechanism by a memory-level asynchronous processing mechanism, pauses writing an online transaction request into a memory, writes the received online transaction request into a database, waits until a subsequent memory is idle, writes the online transaction request in the database into the memory for processing, obtains a transaction flow parameter based on the online transaction request in the database, and records the transaction flow parameter into a flow record table. And after the switching server sends the first switching instruction, the switching server periodically accesses a database of the middle-background application system to acquire the transaction flow parameters in the flow record table.
S302, if the transaction flow parameters do not meet the database-level transaction execution rules, a second switching instruction is sent to the middle-background application system so that the middle-background application system is switched from a database-level asynchronous processing mechanism to a memory-level asynchronous processing mechanism; wherein the database-level transaction execution rules correspond to the memory-level transaction execution rules.
Specifically, after obtaining the transaction flow parameters in the flow record table, the switching server determines whether the transaction flow parameters meet the database-level transaction execution rules, and if the transaction flow parameters meet the database-level transaction execution rules, the switching server directly sends the online transaction request to the middle-background application system for processing after receiving the online transaction request. If the transaction flow parameters do not meet the database-level transaction execution rules, the switching server sends a second switching instruction to the mid-background application system to cause the mid-background application system to switch from the database-level asynchronous processing mechanism to the memory-level asynchronous processing mechanism. After the background application system is switched to the memory level asynchronous processing mechanism, the online transaction request which is not completed in the database is written into the memory, and the subsequently received online transaction request is not written into the database again but is directly written into the memory. The database-level transaction execution rules are preset and set according to actual needs, and the embodiment of the invention is not limited. The second switching instruction is preset and set according to actual needs, and the embodiment of the invention is not limited. It is appreciated that if the transaction flow parameters satisfy the database-level transaction execution rules, the online transaction request continues to be processed using the database-level asynchronous processing mechanism. The database-level transaction execution rules correspond to the memory-level transaction execution rules to ensure that online transaction requests are processed by either a memory-level asynchronous processing mechanism or a database-level asynchronous processing mechanism.
For example, if the transaction flow parameter includes a parameter G, the database-level transaction execution rule includes a database-level transaction execution condition corresponding to the parameter G, and if the parameter G does not satisfy the corresponding database-level transaction execution condition, the transaction flow parameter does not satisfy the database-level transaction execution rule. If the parameter A meets the corresponding database-level transaction execution condition, the transaction flow parameter meets the database-level transaction execution rule.
For example, transaction flow parameters include two parameters: the database-level transaction execution rule comprises a memory-level transaction execution condition corresponding to the parameter H and a memory-level transaction execution condition corresponding to the parameter I. If the parameter H does not meet the corresponding database-level transaction execution condition or the parameter I does not meet the corresponding database-level transaction execution condition, the transaction flow parameter does not meet the database-level transaction execution rule. If the parameter H meets the corresponding database-level transaction execution condition and the parameter I meets the corresponding database-level transaction execution condition, the transaction flow parameter meets the database-level transaction execution rule.
For example, transaction flow parameters include three parameters: the database-level transaction execution rules comprise database-level transaction execution conditions corresponding to the parameters J, database-level transaction execution conditions corresponding to the parameters K and database-level transaction execution conditions corresponding to the parameters M. If any one of the parameters J, K and M does not meet the corresponding database-level transaction execution conditions, the transaction flow parameters do not meet the database-level transaction execution rules. If the parameters J, K and M meet the corresponding database-level transaction execution conditions, respectively, the transaction flow parameters meet the database-level transaction execution rules.
For example, an application server of the middle-background application system may be used as a scheduling server, where the scheduling server is in communication with the switching servers, and after receiving a second switching instruction sent by the switching server, the scheduling server forwards the second switching instruction to each application server, and after receiving the second switching instruction, the application server stops processing the online transaction request by using the memory-level asynchronous processing mechanism and switches to processing the online transaction request by using the database-level asynchronous processing mechanism. Each application server is preconfigured with a memory-level asynchronous processing mechanism and a database-level asynchronous processing mechanism.
For example, the memory level transaction execution rules include that the average number of online transaction requests is less than or equal to a memory queue threshold, and correspondingly, the database level transaction execution rules include that the average number of online transaction requests is greater than the memory queue threshold. The memory-level transaction execution rules include that the average number of the online transaction requests is smaller than or equal to a memory queue threshold and the transaction amount per unit time of the online transaction requests is smaller than or equal to a transaction amount threshold, and correspondingly, the database-level transaction execution rules include that the average number of the online transaction requests is larger than the memory queue threshold and the transaction amount per unit time of the online transaction requests is larger than the transaction amount threshold.
The online transaction processing method provided by the embodiment of the invention enables the database-level asynchronous processing mechanism of the middle-background application system to be switched to the memory-level asynchronous processing mechanism, and can improve the processing efficiency of online transaction requests.
The online transaction processing method provided by the embodiment of the invention can flexibly switch the middle-background application system between the memory-level asynchronous processing mechanism and the database-level asynchronous processing mechanism, thereby improving the resource utilization rate of the middle-background application system.
Further, based on the above embodiments, the transaction flow parameter includes at least one of an average number of online transaction requests, an amount of transactions per unit time, and an average response time.
Specifically, the transaction flow parameter includes at least one of an average number of online transaction requests, an amount of transaction per unit time, and an average response time, i.e., the transaction flow parameter may include any one of an average number of online transaction requests, an amount of transaction per unit time, and an average response time, the transaction flow parameter may include any two of an average number of online transaction requests, an amount of transaction per unit time, and an average response time, and the transaction flow parameter may include an average number of online transaction requests, an amount of transaction per unit time, and an average response time.
The average number of the online transaction requests is obtained by calculating the average value of the number of the online transaction requests in the memory queue in a first preset time period or the average value of the number of the online transaction requests in the database in a second preset time period. For example, the number of online transaction requests in the memory queue is acquired every N seconds in the first preset time period, and if the number of m online transaction requests is acquired in the first preset time period, the average number of the online transaction requests is the average number of the online transaction requestsWherein Q is i The number of the online transaction requests acquired for the ith time is represented, i is a positive integer and is less than or equal to m. The first preset time period and the second preset time period are set according to actual needs, and the embodiment of the invention is not limited.
The unit time transaction amount of the online transaction request is obtained by calculating the average processing amount of the online transaction request in the memory queue in a third preset time period or the average processing amount of the online transaction request in the database in a fourth preset time period. For example, in the third preset period Δt, x online transaction requests in the memory queue are sent to the middle-background application system for processing, and then the online transaction requests have a transaction amount p per unit time 2 =x/Δt. The third preset time period and the fourth preset time period are set according to actual needs, and the embodiment of the invention is not limited.
The average response time of the online transaction requests is obtained by calculating the average value of the response time of each online transaction request entering and exiting the memory queue in a fifth preset time period, or by calculating the average value of the response time of each online transaction request entering and exiting the memory queue in a sixth preset time periodThe average value of the response time of each online transaction request of the database is obtained. For example, the switch server records that n online transaction requests enter the memory queue and leave the memory queue within a third predetermined period of time, i.e., n online transaction requests are sent to the application server by the switch server, then the average response time of the online transaction requestsWherein t is j Representing response time, t, of a jth online transaction request entering and exiting the memory queue within a fifth preset time period j =t j2 -t j1 j,t j2 T is the moment when the j-th online transaction request entering and exiting the memory queue leaves the memory queue j1 And j is a positive integer and is less than or equal to n when the j-th online transaction request entering and exiting the memory queue enters the memory queue. The fifth preset time period is set according to actual needs, and the embodiment of the invention is not limited.
Further, on the basis of the above embodiments, the memory level transaction execution rule includes at least one of a memory level transaction execution condition corresponding to an average number of the online transaction requests, a memory level transaction execution condition corresponding to a unit time transaction amount of the online transaction requests, and a memory level transaction execution condition corresponding to an average response time of the online transaction requests, where:
the memory level transaction execution condition corresponding to the average number of the online transaction requests is that the average number of the online transaction requests is smaller than or equal to a memory queue threshold value;
the memory-level transaction execution condition corresponding to the unit-time transaction amount of the online transaction request is that the unit-time transaction amount of the online transaction request is less than or equal to a transaction amount threshold;
the memory-level transaction execution condition corresponding to the average response time of the online transaction request is that the average response time of the online transaction request is less than or equal to a response time threshold.
Specifically, the memory level transaction execution rule may include at least one of a memory level transaction execution condition corresponding to an average number of online transaction requests, a memory level transaction execution condition corresponding to a unit time transaction amount of the online transaction requests, and a memory level transaction execution condition corresponding to an average response time of the online transaction requests, that is, the transaction flow parameter may include any one of a memory level transaction execution condition corresponding to an average number of the online transaction requests, a memory level transaction execution condition corresponding to a unit time transaction amount of the online transaction requests, and a memory level transaction execution condition corresponding to an average response time of the online transaction requests, and the transaction flow parameter may include any two of a memory level transaction execution condition corresponding to an average number of the online transaction requests, a memory level transaction execution condition corresponding to a unit time transaction amount of the online transaction requests, and a memory level transaction execution condition corresponding to an average response time of the online transaction requests.
The switch server compares the average number of online transaction requests with a memory queue threshold, and if the average number of online transaction requests is greater than the memory queue threshold, it may be determined that the average number of online transaction requests does not satisfy a corresponding memory-level transaction execution condition. If the average number of online transaction requests is less than or equal to the memory queue threshold, then it may be determined that the average number of online transaction requests meets a corresponding memory level transaction execution condition. The memory queue threshold is set according to practical experience, and the embodiment of the invention is not limited.
The switching server compares the unit time transaction amount of the online transaction request with a transaction amount threshold, and if the unit time transaction amount of the online transaction request is greater than the transaction amount threshold, it may be determined that the unit time transaction amount of the online transaction request does not satisfy the corresponding memory-level transaction execution condition. If the amount of transactions per unit time of the online transaction request is less than or equal to the transaction amount threshold, it may be determined that the amount of transactions per unit time of the online transaction request satisfies a corresponding memory-level transaction execution condition. The transaction amount threshold is set according to practical experience, and the embodiment of the invention is not limited.
The switch server compares the average response time of the online transaction request with a response time threshold, and if the average response time of the online transaction request is greater than the response time threshold, it may be determined that the average response time of the online transaction request does not satisfy the corresponding memory-level transaction execution condition. If the average response time of the online transaction request is less than or equal to the response time threshold, it may be determined that the average response time of the online transaction request meets a corresponding memory-level transaction execution condition. The response time threshold is set according to practical experience, and the embodiment of the invention is not limited.
Further, on the basis of the above embodiments, the database-level transaction execution rule includes at least one of a database-level transaction execution condition corresponding to an average number of the online transaction requests, a database-level transaction execution condition corresponding to a unit-time transaction amount of the online transaction requests, and a database-level transaction execution condition corresponding to an average response time of the online transaction requests, wherein:
the database-level transaction execution condition corresponding to the average number of the online transaction requests is that the average number of the online transaction requests is larger than a memory queue threshold;
The database-level transaction execution condition corresponding to the unit-time transaction amount of the online transaction request is that the unit-time transaction amount of the online transaction request is larger than a transaction amount threshold.
The database-level transaction execution condition corresponding to the average response time of the online transaction request is that the average response time of the online transaction request is greater than a response time threshold.
Specifically, the database-level transaction execution rule may include at least one of a database-level transaction execution condition corresponding to an average number of the online transaction requests, a database-level transaction execution condition corresponding to a unit time transaction amount of the online transaction requests, and a database-level transaction execution condition corresponding to an average response time of the online transaction requests, that is, the transaction flow parameter may include any one of a database-level transaction execution condition corresponding to an average number of the online transaction requests, a database-level transaction execution condition corresponding to a unit time transaction amount of the online transaction requests, and a database-level transaction execution condition corresponding to an average response time of the online transaction requests, and the transaction flow parameter may include any two of a database-level transaction execution condition corresponding to an average number of the online transaction requests, a database-level transaction execution condition corresponding to a unit time transaction amount of the online transaction requests, and a database-level transaction execution condition corresponding to an average response time of the online transaction requests.
The switch server compares the average number of online transaction requests to a memory queue threshold, and if the average number of online transaction requests is greater than the memory queue threshold, may determine that the average number of online transaction requests satisfies a corresponding database-level transaction execution condition. If the average number of online transaction requests is less than or equal to the memory queue threshold, it may be determined that the average number of online transaction requests does not satisfy the corresponding database-level transaction execution condition. The memory queue threshold is set according to practical experience, and the embodiment of the invention is not limited.
The switching server compares the unit time transaction amount of the online transaction request with a transaction amount threshold, and if the unit time transaction amount of the online transaction request is greater than the transaction amount threshold, it may be determined that the unit time transaction amount of the online transaction request satisfies a corresponding database-level transaction execution condition. If the amount of transactions per unit time of the online transaction request is less than or equal to the transaction amount threshold, it may be determined that the amount of transactions per unit time of the online transaction request does not satisfy the corresponding database-level transaction execution condition. The transaction amount threshold is set according to practical experience, and the embodiment of the invention is not limited.
The switch server compares the average response time of the online transaction request to a response time threshold, and if the average response time of the online transaction request is greater than the response time threshold, may determine that the average response time of the online transaction request satisfies a corresponding database-level transaction execution condition. If the average response time of the online transaction request is less than or equal to the response time threshold, it may be determined that the average response time of the online transaction request does not satisfy the corresponding database-level transaction execution condition. The response time threshold is set according to practical experience, and the embodiment of the invention is not limited.
Based on the above embodiments, the online transaction processing method provided by the embodiment of the present invention further includes:
and if the transaction flow parameters meet the memory-level transaction execution rules, pushing an online transaction request to the middle-background application system for processing according to a first-in first-out principle.
Specifically, after the switching server obtains the transaction flow parameter, the switching server determines whether the transaction flow parameter meets a memory level transaction execution rule, and if the transaction flow parameter meets the memory level transaction execution rule, the switching server pushes an online transaction request to the middle-background application system for processing according to a first-in first-out principle, namely, sends the online transaction request to the middle-background application system for processing according to the time sequence written into the memory queue.
For example, an application server of the middle-background application system may be used as a load balancing server, where the load balancing server is in communication connection with the switching server, and after receiving an online transaction request pushed by the switching server, the load balancing server determines the application server that processes the online transaction request based on a preset load balancing policy, and then sends the online transaction request to the application server. The load balancing strategy is set according to actual needs, and the embodiment of the invention is not limited.
Fig. 4 is a flow chart of an online transaction processing method according to another embodiment of the present invention, and as shown in fig. 4, the implementation flow of the online transaction processing method according to the embodiment of the present invention is as follows:
and a first step of reading configuration information. After the switching server is started, the configuration information is read, transaction flow parameters and memory level transaction execution rules which need to be calculated are obtained through analysis from the configuration information, the transaction flow parameters and the memory level transaction execution rules are written into a memory, and a memory queue is initialized. The configuration information is preset, and what transaction flow parameters and memory level transaction execution rules are adopted are set in the configuration information.
And a second step of receiving an online transaction request. The switching server receives the online transaction requests sent by the foreground terminals and writes the online transaction requests into the memory queue according to the receiving sequence.
And thirdly, obtaining transaction flow parameters. The switching server calculates and obtains transaction flow parameters based on the online transaction requests in the memory queue.
And fourthly, judging whether the memory level transaction execution rule is met. The switching server judges whether the transaction flow parameters meet the memory level transaction execution rules, and if so, the fifth step is entered; if the transaction flow parameters are judged not to meet the memory level transaction execution rules, a sixth step is entered.
And fifthly, pushing an online transaction request. The switching server pushes the online transaction request to the middle-background application system for processing according to the first-in first-out principle.
And sixthly, sending a first switching instruction. And the switching server sends a first switching instruction to the middle-background application system so that the middle-background application system is switched from the memory-level asynchronous processing mechanism to the database-level asynchronous processing mechanism.
And seventh, acquiring transaction flow parameters. The switching server periodically acquires transaction flow parameters from a flow record table of a database of the background application system. Wherein, the transaction flow parameters in the flow record table are pre-calculated and stored in the flow record table.
Eighth, judge whether to meet the execution rule of the trade of the database level. The switching server judges whether the transaction flow parameters meet the database-level transaction execution rules, and if so, the ninth step is carried out; if the transaction flow parameters are judged not to meet the database transaction execution rules, a tenth step is entered.
And ninth, forwarding the online transaction request. And the switching server directly forwards the received online transaction request to the middle-background application system for processing.
And tenth, sending a second switching instruction. And the switching server sends a second switching instruction to the middle-background application system so that the middle-background application system is switched from the database-level asynchronous processing mechanism to the memory-level asynchronous processing mechanism.
According to the online transaction processing method provided by the embodiment of the invention, when online transaction is instantaneously fluctuated, the high availability of the system and the saving of database resources are considered, and meanwhile, the user experience and the usability of the system are improved. The advantages are as follows:
(1) In the process of online transaction processing, the processing capacity of the system is dynamically monitored, a memory-level asynchronous processing mechanism and a database-level asynchronous processing mechanism are flexibly switched, and the resource utilization rate of the system is improved.
(2) The system has the advantages that the customized and configured transaction flow parameters, memory-level transaction execution rules and database-level transaction execution rules can be customized and configured, and the flexibility of the system is improved.
(3) Configuration information is stored in the memory, so that the processing efficiency is improved.
Fig. 5 is a schematic structural diagram of an online transaction processing device according to an embodiment of the present invention, and as shown in fig. 5, the online transaction processing device according to an embodiment of the present invention includes a receiving unit 501, an obtaining unit 502, and a first switching unit 503, where:
the receiving unit 501 is configured to receive an online transaction request and write the online transaction request into a memory queue; the obtaining unit 502 is configured to obtain a transaction flow parameter based on the online transaction request in the memory queue; the first switching unit 503 is configured to send a first switching instruction to the mid-background application system after the transaction flow parameter does not meet the memory level transaction execution rule, so that the mid-background application system is switched from the memory level asynchronous processing mechanism to the database level asynchronous processing mechanism.
Specifically, the foreground terminal of the foreground application system sends the online transaction request to the receiving unit 501, and the receiving unit 501 receives each online transaction request and then writes each online transaction request into the memory queue one by one. Wherein the online transaction request includes, but is not limited to, a financial purchase request, an online banking login request, a balance inquiry request, a transfer request, a payment request, and the like.
After writing the online transaction request into the memory queue, the obtaining unit 502 obtains a transaction flow parameter based on the online transaction request in the memory queue. The transaction flow parameters include, but are not limited to, an average number of online transaction requests, an average transaction amount per unit time, and an average response time, which are set according to actual needs, and the embodiment of the invention is not limited.
After obtaining the transaction flow parameter, the first switching unit 503 determines whether the transaction flow parameter meets a memory level transaction execution rule, and if the transaction flow parameter meets the memory level transaction execution rule, the switching server sends an online transaction request to an application server of the middle-background application system for processing. If the transaction flow parameters do not meet the memory level transaction execution rules, the switching server sends a first switching instruction to the mid-background application system so that the mid-background application system is switched from a memory level asynchronous processing mechanism to a database level asynchronous processing mechanism. The memory level transaction execution rule is preset and set according to actual needs, and the embodiment of the invention is not limited. The first switching instruction is preset and set according to actual needs, and the embodiment of the invention is not limited. The memory level asynchronous processing mechanism and the database level asynchronous processing mechanism are preconfigured to the middle-background application system.
The online transaction processing device provided by the embodiment of the invention can receive the online transaction request and write the online transaction request into the memory queue, obtains the transaction flow parameter based on the online transaction request in the memory queue, and sends the first switching instruction to the middle-background application system after the transaction flow parameter does not meet the memory-level transaction execution rule so that the middle-background application system is switched from the memory-level asynchronous processing mechanism to the database-level asynchronous processing mechanism, thereby avoiding the impact of the online transaction request on the middle-background application system during service peaks and ensuring the online transaction processing stability of the middle-background application system.
Fig. 6 is a schematic structural diagram of an online transaction processing device according to another embodiment of the present invention, as shown in fig. 6, further, based on the above embodiments, the online transaction processing device according to the embodiment of the present invention further includes an obtaining unit 504 and a second switching unit 505, where:
the obtaining unit 504 is configured to obtain transaction flow parameters from a flow record table of a database of the background application system periodically; the second switching unit 505 is configured to send a second switching instruction to the middle-background application system after the transaction flow parameter does not meet the database-level transaction execution rule, so that the middle-background application system is switched from the database-level asynchronous processing mechanism to the memory-level asynchronous processing mechanism; wherein the database-level transaction execution rules correspond to the memory-level transaction execution rules.
Specifically, after receiving the first switching instruction, the middle-background application system switches to a database-level asynchronous processing mechanism by a memory-level asynchronous processing mechanism, pauses writing an online transaction request into a memory, writes the received online transaction request into a database, waits until a subsequent memory is idle, writes the online transaction request in the database into the memory for processing, obtains a transaction flow parameter based on the online transaction request in the database, and records the transaction flow parameter into a flow record table. After sending the first switching instruction, the obtaining unit 504 may access the database of the mid-background application system periodically to obtain the transaction flow parameters in the flow record table.
After obtaining the transaction flow parameters in the flow record table, the second switching unit 505 determines whether the transaction flow parameters meet the database-level transaction execution rules, and if the transaction flow parameters meet the database-level transaction execution rules, the switching server directly sends the online transaction request to the middle-background application system for processing after receiving the online transaction request. If the transaction flow parameters do not meet the database-level transaction execution rules, the switching server sends a second switching instruction to the mid-background application system to cause the mid-background application system to switch from the database-level asynchronous processing mechanism to the memory-level asynchronous processing mechanism. After the background application system is switched to the memory level asynchronous processing mechanism, the online transaction request which is not completed in the database is written into the memory, and the subsequently received online transaction request is not written into the database again but is directly written into the memory. The database-level transaction execution rules are preset and set according to actual needs, and the embodiment of the invention is not limited. The second switching instruction is preset and set according to actual needs, and the embodiment of the invention is not limited. It is appreciated that if the transaction flow parameters satisfy the database-level transaction execution rules, the online transaction request continues to be processed using the database-level asynchronous processing mechanism. The database-level transaction execution rules correspond to the memory-level transaction execution rules to ensure that online transaction requests are processed by either a memory-level asynchronous processing mechanism or a database-level asynchronous processing mechanism.
The embodiment of the apparatus provided in the embodiment of the present invention may be specifically used to execute the processing flow of each method embodiment, and the functions thereof are not described herein again, and may refer to the detailed description of the method embodiments.
It should be noted that, the online transaction processing method and the online transaction processing device provided by the embodiment of the invention can be used in the financial field and also can be used in any technical field except the financial field, and the application field of the online transaction processing method and the online transaction processing device is not limited.
Fig. 7 is a schematic physical structure of an electronic device according to an embodiment of the present invention, as shown in fig. 7, the electronic device may include: a processor (processor) 701, a communication interface (Communications Interface) 702, a memory (memory) 703 and a communication bus 704, wherein the processor 701, the communication interface 702 and the memory 703 communicate with each other through the communication bus 704. The processor 701 may call logic instructions in the memory 703 to perform the following method: receiving an online transaction request and writing the online transaction request into a memory queue; acquiring transaction flow parameters based on the online transaction requests in the memory queue; and if the transaction flow parameters do not meet the memory-level transaction execution rules, sending a first switching instruction to the middle-background application system so that the middle-background application system is switched from the memory-level asynchronous processing mechanism to the database-level asynchronous processing mechanism.
Further, the logic instructions in the memory 703 may be implemented in the form of software functional units and may be stored in a computer readable storage medium when sold or used as a stand alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The present embodiment discloses a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, are capable of performing the methods provided by the above-described method embodiments, for example comprising: receiving an online transaction request and writing the online transaction request into a memory queue; acquiring transaction flow parameters based on the online transaction requests in the memory queue; and if the transaction flow parameters do not meet the memory-level transaction execution rules, sending a first switching instruction to the middle-background application system so that the middle-background application system is switched from the memory-level asynchronous processing mechanism to the database-level asynchronous processing mechanism.
The present embodiment provides a computer-readable storage medium storing a computer program that causes the computer to execute the methods provided by the above-described method embodiments, for example, including: receiving an online transaction request and writing the online transaction request into a memory queue; acquiring transaction flow parameters based on the online transaction requests in the memory queue; and if the transaction flow parameters do not meet the memory-level transaction execution rules, sending a first switching instruction to the middle-background application system so that the middle-background application system is switched from the memory-level asynchronous processing mechanism to the database-level asynchronous processing mechanism.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In the description of the present specification, reference to the terms "one embodiment," "one particular embodiment," "some embodiments," "for example," "an example," "a particular example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The foregoing description of the embodiments has been provided for the purpose of illustrating the general principles of the invention, and is not meant to limit the scope of the invention, but to limit the invention to the particular embodiments, and any modifications, equivalents, improvements, etc. that fall within the spirit and principles of the invention are intended to be included within the scope of the invention.

Claims (8)

1. An on-line transaction processing method, comprising:
receiving an online transaction request and writing the online transaction request into a memory queue;
acquiring transaction flow parameters based on the online transaction requests in the memory queue;
if the transaction flow parameters do not meet the memory-level transaction execution rules, a first switching instruction is sent to the middle-background application system so that the middle-background application system is switched from a memory-level asynchronous processing mechanism to a database-level asynchronous processing mechanism;
periodically acquiring transaction flow parameters from a flow record table of a database of the middle background application system;
if the transaction flow parameters do not meet the database-level transaction execution rules, a second switching instruction is sent to the middle-background application system so that the middle-background application system is switched from a database-level asynchronous processing mechanism to a memory-level asynchronous processing mechanism; wherein the database-level transaction execution rules correspond to the memory-level transaction execution rules.
2. The method of claim 1, wherein the transaction flow parameters include at least one of an average number of online transaction requests, an amount of transactions per unit time, and an average response time.
3. The method of claim 2, wherein the memory level transaction execution rules include at least one of a memory level transaction execution condition corresponding to an average number of the online transaction requests, a memory level transaction execution condition corresponding to a unit time transaction amount of the online transaction requests, and a memory level transaction execution condition corresponding to an average response time of the online transaction requests, wherein:
the memory level transaction execution condition corresponding to the average number of the online transaction requests is that the average number of the online transaction requests is smaller than or equal to a memory queue threshold value;
the memory-level transaction execution condition corresponding to the unit-time transaction amount of the online transaction request is that the unit-time transaction amount of the online transaction request is less than or equal to a transaction amount threshold;
the memory-level transaction execution condition corresponding to the average response time of the online transaction request is that the average response time of the online transaction request is less than or equal to a response time threshold.
4. The method of claim 2, wherein the database-level transaction execution rules include at least one of a database-level transaction execution condition corresponding to an average number of the online transaction requests, a database-level transaction execution condition corresponding to a unit-time transaction amount of the online transaction requests, and a database-level transaction execution condition corresponding to an average response time of the online transaction requests, wherein:
The database-level transaction execution condition corresponding to the average number of the online transaction requests is that the average number of the online transaction requests is larger than a memory queue threshold;
the database-level transaction execution condition corresponding to the unit-time transaction amount of the online transaction request is that the unit-time transaction amount of the online transaction request is larger than a transaction amount threshold;
the database-level transaction execution condition corresponding to the average response time of the online transaction request is that the average response time of the online transaction request is greater than a response time threshold.
5. The method as recited in claim 1, further comprising:
and if the transaction flow parameters meet the memory-level transaction execution rules, pushing an online transaction request to the middle-background application system for processing according to a first-in first-out principle.
6. An on-line transaction processing device, comprising:
the receiving unit is used for receiving the online transaction request and writing the online transaction request into the memory queue;
the obtaining unit is used for obtaining transaction flow parameters based on the online transaction requests in the memory queue;
the first switching unit is used for sending a first switching instruction to the middle-background application system after the transaction flow parameter does not meet the memory-level transaction execution rule so that the middle-background application system is switched from a memory-level asynchronous processing mechanism to a database-level asynchronous processing mechanism;
The acquisition unit is used for periodically acquiring transaction flow parameters from a flow record table of a database of the middle background application system;
the second switching unit is used for sending a second switching instruction to the middle-background application system after the transaction flow parameter does not meet the database-level transaction execution rule so that the middle-background application system is switched from the database-level asynchronous processing mechanism to the memory-level asynchronous processing mechanism; wherein the database-level transaction execution rules correspond to the memory-level transaction execution rules.
7. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method of any one of claims 1 to 5 when the computer program is executed by the processor.
8. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any one of claims 1 to 5.
CN202110079935.3A 2021-01-21 2021-01-21 Online transaction processing method and device Active CN112767159B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110079935.3A CN112767159B (en) 2021-01-21 2021-01-21 Online transaction processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110079935.3A CN112767159B (en) 2021-01-21 2021-01-21 Online transaction processing method and device

Publications (2)

Publication Number Publication Date
CN112767159A CN112767159A (en) 2021-05-07
CN112767159B true CN112767159B (en) 2024-03-26

Family

ID=75702125

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110079935.3A Active CN112767159B (en) 2021-01-21 2021-01-21 Online transaction processing method and device

Country Status (1)

Country Link
CN (1) CN112767159B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104407922A (en) * 2014-10-29 2015-03-11 中国建设银行股份有限公司 Asynchronous batch-processing dispatching method and system
CN110310192A (en) * 2019-05-23 2019-10-08 平安银行股份有限公司 Transaction processing method, device, equipment and storage medium based on data analysis
CN111124718A (en) * 2019-12-31 2020-05-08 中国银行股份有限公司 Parameter data acquisition method, parameter data processing method and device and electronic equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104407922A (en) * 2014-10-29 2015-03-11 中国建设银行股份有限公司 Asynchronous batch-processing dispatching method and system
CN110310192A (en) * 2019-05-23 2019-10-08 平安银行股份有限公司 Transaction processing method, device, equipment and storage medium based on data analysis
CN111124718A (en) * 2019-12-31 2020-05-08 中国银行股份有限公司 Parameter data acquisition method, parameter data processing method and device and electronic equipment

Also Published As

Publication number Publication date
CN112767159A (en) 2021-05-07

Similar Documents

Publication Publication Date Title
WO2016177249A1 (en) Method and device for processing refund information
CN110413416B (en) Current limiting method and device for distributed server
JP2018517976A (en) Dialog data processing method and apparatus
CN104980468A (en) Method, device and system for processing service request
CN108038687B (en) Transaction method based on voice recognition, server and computer-readable storage medium
CN103546388B (en) A kind of flow control methods and device
CN110009365B (en) User group detection method, device and equipment for abnormally transferring electronic assets
CN108492109B (en) Electronic device, dynamic code request processing method and storage medium
CN113378855A (en) Method for processing multitask, related device and computer program product
CN110956500B (en) Method and system for reducing advertisement request time consumption in advertisement real-time bidding system
CN111984733A (en) Data transmission method and device based on block chain and storage medium
CN108959047B (en) Pressure testing method and device based on service scene
CN112767159B (en) Online transaction processing method and device
EP3479606A1 (en) A method of enabling improved efficiency in a first communications network, network entity, network device, computer programs and computer program products
CN112948081A (en) Method, device and equipment for processing task in delayed mode and storage medium
CN117499309A (en) Method, apparatus, electronic device, and computer-readable medium for flow control
CN110990007A (en) Bank software function interface generation method and device
CN115760317A (en) Business order processing method and device, computer equipment and storage medium
CN104767880A (en) Communication number management method
CN109712011B (en) Community discovery method and device
CN113553203A (en) Request processing method, device, server and storage medium
CN112767160A (en) Online transaction processing method and device based on memory
CN111506486A (en) Data processing method and system
CN105550020A (en) Object selection method and apparatus
CN110855764A (en) Network traffic scheduling method and device and electronic equipment

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