CN113989046A - Transaction processing method, apparatus, electronic device, storage medium, and program product - Google Patents

Transaction processing method, apparatus, electronic device, storage medium, and program product Download PDF

Info

Publication number
CN113989046A
CN113989046A CN202111310243.1A CN202111310243A CN113989046A CN 113989046 A CN113989046 A CN 113989046A CN 202111310243 A CN202111310243 A CN 202111310243A CN 113989046 A CN113989046 A CN 113989046A
Authority
CN
China
Prior art keywords
transaction
task
tasks
business process
processing
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
CN202111310243.1A
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.)
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 CN202111310243.1A priority Critical patent/CN113989046A/en
Publication of CN113989046A publication Critical patent/CN113989046A/en
Pending legal-status Critical Current

Links

Images

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)
  • Computer And Data Communications (AREA)

Abstract

The present disclosure provides a transaction processing method, which can be applied to the technical field of transaction processing in the financial field. The transaction processing method comprises the following steps: obtaining a plurality of transaction requests; identifying at least one communication protocol included in the plurality of transaction requests; determining a plurality of transaction tasks corresponding to a plurality of transaction requests according to at least one preset decoding rule, wherein the at least one decoding rule corresponds to at least one communication protocol one to one; and scheduling at least one business process for the transaction tasks so as to process the transaction tasks in parallel through the at least one business process to obtain a processing result, wherein the business process is used for processing the at least one transaction task in batches. The present disclosure also provides a transaction processing apparatus, a device, a storage medium and a program product.

Description

Transaction processing method, apparatus, electronic device, storage medium, and program product
Technical Field
The present disclosure relates to the field of finance, in particular to the field of transaction processing in the field of finance, and more particularly to a transaction method, apparatus, device, medium and program product.
Background
With the development of information technology, the technical means for processing financial transactions through internet technology is becoming more and more abundant. However, since the financial transactions processed by banks usually involve multiple application scenarios and multiple protocols, the conventional distributed system processing is slightly insufficient when facing large-batch financial transactions. Therefore, it is necessary to design a distributed system supporting high concurrency and high availability for processing financial transactions.
Disclosure of Invention
In view of the above, the present disclosure provides a transaction processing method, apparatus, device, medium, and program product.
According to a first aspect of the present disclosure, there is provided a transaction processing method comprising: obtaining a plurality of transaction requests; identifying at least one communication protocol included in the plurality of transaction requests; determining a plurality of transaction tasks corresponding to a plurality of transaction requests according to at least one preset decoding rule, wherein the at least one decoding rule corresponds to the at least one communication protocol one by one; and scheduling at least one business process for the plurality of transaction tasks so as to perform parallel processing on the plurality of transaction tasks through the at least one business process to obtain a processing result, wherein the business process is used for processing at least one transaction task in batch.
According to an embodiment of the present disclosure, the determining, according to at least one preset decoding rule, a plurality of transaction tasks corresponding to a plurality of transaction requests includes: based on the identified at least one communication protocol, distributing the transaction requests to at least one parser, wherein each parser is used for parsing the transaction requests corresponding to one communication protocol through a preset decoding rule; analyzing the plurality of transaction requests through the at least one analyzer to obtain a plurality of messages corresponding to the plurality of transaction requests; checking the plurality of messages to obtain at least one message passing the checking; and respectively determining at least one transaction task corresponding to the at least one message passing the verification.
According to the embodiment of the disclosure, the verification includes one of message length verification, message type verification, message version verification and non-null verification.
According to an embodiment of the present disclosure, before the verifying the plurality of packets to obtain at least one packet that passes the verification, the method further includes: and converting the formats of the messages into preset data formats.
According to an embodiment of the present disclosure, the scheduling at least one business process for a plurality of transaction tasks includes: determining a plurality of business units respectively corresponding to the plurality of transaction tasks; and scheduling at least one service process according to the types and the number of the plurality of service units, wherein each service process is used for processing the service units with preset number and preset types.
According to an embodiment of the present disclosure, the at least one business process includes a plurality of business processes, the processing result is obtained by performing parallel processing on the plurality of transaction tasks through the at least one business process, and the business process is configured to process at least one of the transaction tasks in batch, and includes: determining a main transaction task of at least one transaction task executed in each business process and an associated sub-transaction task of the main transaction task; executing the corresponding main transaction task and the associated subtask in parallel in a plurality of business processes to obtain an execution state; and obtaining a processing result according to the execution state.
According to an embodiment of the present disclosure, the at least one business process includes a business process, the processing result is obtained by performing parallel processing on the plurality of transaction tasks through the at least one business process, and the business process is configured to process at least one of the transaction tasks in batch, and includes: determining a main transaction task of at least one transaction task in the business process and an associated subtask of the main transaction task; executing the main transaction task and the associated sub transaction tasks in parallel at a plurality of task points of the business process to obtain an execution state; and obtaining a processing result according to the execution state.
According to an embodiment of the present disclosure, the obtaining a processing result according to the execution state includes: initializing an execution log, wherein the execution log is used for recording the execution state of each transaction task; and updating the execution state of each transaction task in the execution log in sequence according to the execution sequence of the transaction tasks to obtain a processing result.
According to an embodiment of the present disclosure, the method further comprises: under the condition that the plurality of business processes are determined to be executed and completed in a plurality of application programs, processing the plurality of transaction requests in the plurality of application programs by sending online requests to obtain processing results; wherein the online request is used for requesting the plurality of application programs to jointly execute the plurality of business processes.
A second aspect of the present disclosure provides a transaction processing apparatus comprising: an acquisition module for acquiring a plurality of transaction requests; an identification module to identify at least one communication protocol included in the plurality of transaction requests; the first determining module is used for determining a plurality of transaction tasks corresponding to a plurality of transaction requests according to at least one preset decoding rule, wherein the at least one decoding rule corresponds to the at least one communication protocol one by one; and the scheduling module is used for scheduling at least one business process for a plurality of transaction tasks so as to perform parallel processing on the transaction tasks through the at least one business process to obtain a processing result, and the business process is used for processing at least one transaction task in batches.
According to an embodiment of the present disclosure, the first determining module includes: the distribution unit is used for distributing the transaction requests to at least one parser based on the identified at least one communication protocol, and each parser is used for parsing the transaction requests corresponding to one communication protocol through one preset decoding rule; the analysis unit is used for analyzing the plurality of transaction requests through the at least one analyzer to obtain a plurality of messages corresponding to the plurality of transaction requests; the checking unit is used for checking the plurality of messages to obtain at least one message passing the checking; and the first determining unit is used for respectively determining at least one transaction task corresponding to at least one message passing the verification.
According to an embodiment of the present disclosure, the determining module further comprises: and the conversion unit is used for converting the formats of the messages into a preset data format before the plurality of messages are verified to obtain at least one verified message.
According to an embodiment of the present disclosure, the scheduling module includes: a second determining unit, configured to determine a plurality of business units respectively corresponding to the plurality of transaction tasks; and the scheduling unit is used for scheduling at least one service process according to the types and the number of the plurality of service units, and each service process is used for processing the service units with preset number and preset types.
According to an embodiment of the present disclosure, the at least one business process includes a plurality of business processes, and the scheduling module includes: a third determining unit, configured to determine a main transaction task of at least one transaction task executed in each business process and an associated sub-transaction task of the main transaction task; the first execution unit is used for executing the corresponding main transaction task and the associated subtask in parallel in a plurality of business processes to obtain an execution state; and a first obtaining unit configured to obtain a processing result according to the execution state.
According to an embodiment of the present disclosure, the at least one business process includes one business process, and the scheduling module includes: a fourth determining unit, configured to determine a main transaction task of at least one transaction task in the business process and an associated subtask of the main transaction task; the second execution unit is used for executing the main transaction task and the associated sub-transaction tasks in parallel at a plurality of task points of the business process to obtain an execution state; and a second obtaining unit configured to obtain a processing result according to the execution state.
According to an embodiment of the present disclosure, the obtaining unit includes: the device comprises an initialization unit, a processing unit and a processing unit, wherein the initialization unit is used for initializing an execution log, and the execution log is used for recording the execution state of each transaction task; and the updating unit is used for sequentially updating the execution state of each transaction task in the execution log according to the execution sequence of the transaction tasks to obtain a processing result.
According to an embodiment of the present disclosure, the apparatus further comprises: the second determining module is used for completing the processing of the transaction requests in the application programs by sending online requests under the condition that the business processes are determined to be executed and completed in the application programs, and obtaining processing results; wherein the online request is used for requesting the plurality of application programs to jointly execute the plurality of business processes.
A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the transaction processing method described above.
A fourth aspect of the present disclosure also provides a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the above-described transaction processing method.
A fifth aspect of the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements the above-described transaction processing method.
Drawings
The foregoing and other objects, features and advantages of the disclosure will be apparent from the following description of embodiments of the disclosure, which proceeds with reference to the accompanying drawings, in which:
fig. 1 schematically illustrates a system architecture of a transaction processing method, apparatus, device, medium, and program product according to embodiments of the disclosure;
FIG. 2 schematically illustrates an application scenario diagram of a transaction processing method, apparatus, device, medium and program product according to an embodiment of the disclosure;
FIG. 3 schematically shows a flow diagram of a transaction processing method according to an embodiment of the present disclosure;
FIG. 4 schematically illustrates a flow chart for determining a transaction task corresponding to a transaction request according to an embodiment of the disclosure;
FIG. 5 schematically illustrates a flow diagram for scheduling business processes for transaction tasks according to an embodiment of the disclosure;
FIG. 6 schematically shows a flow chart for obtaining processing results according to an embodiment of the present disclosure;
FIG. 7 schematically shows a flow diagram of a transaction processing method according to another embodiment of the present disclosure;
fig. 8 schematically shows a block diagram of the structure of a transaction processing device according to an embodiment of the present disclosure; and
fig. 9 schematically shows a block diagram of an electronic device adapted to implement a transaction processing method according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
It should be noted that the transaction processing method and apparatus of the embodiments of the present disclosure may be used in the financial field, in particular, in the transaction processing field of the financial field, and may also be used in any field other than the financial field. The present disclosure will be described in detail below with reference to the drawings and specific embodiments.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the personal information of the related user all accord with the regulations of related laws and regulations, necessary security measures are taken, and the customs of the public order is not violated.
The embodiment of the disclosure provides a transaction processing method, which obtains a plurality of transaction requests;
identifying at least one communication protocol included in the plurality of transaction requests; determining a plurality of transaction tasks corresponding to a plurality of transaction requests according to at least one preset decoding rule, wherein the at least one decoding rule corresponds to at least one communication protocol one to one; and scheduling at least one business process for the transaction tasks so as to process the transaction tasks in parallel through the at least one business process to obtain a processing result, wherein the business process is used for processing the at least one transaction task in batches.
FIG. 1 schematically illustrates a system architecture for transaction processing according to an embodiment of the present disclosure.
As shown in fig. 1, an exemplary system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (for example only) providing support for websites browsed by users using the terminal devices 101, 102, 103. The background management server may analyze and perform other processing on the received data such as the user request, and feed back a processing result (e.g., a webpage, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that the transaction processing method provided by the embodiment of the present disclosure may be generally executed by the server 105. Accordingly, the transaction processing device provided by the embodiments of the present disclosure may be generally disposed in the server 105. The transaction processing method provided by the embodiment of the present disclosure may also be executed by a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the transaction processing device provided by the embodiment of the present disclosure may also be disposed in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Fig. 2 schematically illustrates an application scenario diagram of a transaction processing method, apparatus, device, medium, and program product according to embodiments of the present disclosure.
In embodiments of the present disclosure, the transaction request 210 may include a variety of different communication protocols. Such as AMQP communication protocol, JMS communication protocol, HTTP communication protocol, COAP communication protocol, DDS communication protocol, MQTT communication protocol, and so forth. The first application 220 and the second application 230 include a plurality of communication ports, one of which listens for transaction requests that include a communication protocol. The first application 220 and the second application 230 may process the transaction request through an online service association. For example, the first application 220 receives a plurality of transaction requests transmitted from an upstream system, the second application 230 may acquire data of a downstream system and transmit the acquired data to the first application 220, and the first application 220 processes the transaction requests based on the received data and transmits the processed result to the upstream system.
The first application 220 and the second application 230 each batch process a large number of transaction requests. During batch processing, the first application 220 and the second application 230 are in an offline state. The batch process is completed only within the first application 220 or the second application 230.
The transaction processing method of the disclosed embodiment will be described in detail below with reference to fig. 3 to 7 based on the scenario described in fig. 2.
Fig. 3 schematically shows a flow chart of a transaction processing method according to an embodiment of the present disclosure.
As shown in fig. 3, the transaction processing method of this embodiment includes operations S310 to S340.
In operation S310, a plurality of transaction requests are obtained.
The transaction request may be a transaction request of the user sent by the head-end system. Such as payment requests and transfer requests by the user, etc. The transaction request may also be a transaction request sent by one application to another application within the server. For example, requesting to obtain account information of a user, requesting to obtain historical payment records, requesting to verify user identity information, and the like
In operation S320, at least one communication protocol included in the plurality of transaction requests is identified.
Typically, each transaction request is communicated in one communication protocol. The communication protocol included with each transaction request may or may not be the same. The communication protocol defines the data format of the transaction request, the information and meaning of the transaction request, the connection mode between communication systems, the time sequence of information transmission and reception, and the like.
In operation S330, a plurality of transaction tasks corresponding to the plurality of transaction requests are determined according to at least one preset decoding rule, where the at least one decoding rule corresponds to at least one communication protocol.
For different communication protocols, the contents in the transaction requests need to be parsed by different decoding rules to determine the transaction task corresponding to each transaction request. One transaction request corresponds to at least one transaction task. After successful execution of at least one transaction task corresponding to a transaction request, processing of the transaction request may be deemed complete.
In operation S340, at least one business process is scheduled for the multiple transaction tasks, so that the multiple transaction tasks are processed in parallel by the at least one business process, and a processing result is obtained.
The plurality of transaction tasks determined for the plurality of transaction requests may be executed by scheduling a number of business processes. For example, a plurality of transaction tasks corresponding to a plurality of transaction requests may schedule a business process to execute, where the business process processes the transaction tasks in parallel. For another example, one business process executes all transaction tasks corresponding to one transaction request, and a plurality of business processes execute transaction tasks corresponding to a plurality of transaction requests, respectively, wherein the plurality of transaction requests correspond to the plurality of business processes one to one. And the business processes synchronously execute the transaction tasks so as to realize the parallel processing of the transaction tasks through the business processes. For another example, a plurality of business processes execute transaction tasks corresponding to a plurality of transaction requests, and a plurality of transaction tasks corresponding to a certain transaction request are executed by a plurality of business processes. Each business process may be used to batch process multiple transaction tasks. And the business processes synchronously execute the transaction tasks so as to realize the parallel processing of the transaction tasks through the business processes.
In the embodiment of the disclosure, the transaction requests including multiple communication protocols are decoded through multiple preset decoding rules, so that flexible expansion under the multiple communication protocols is realized. A certain number of business processes are scheduled for a plurality of transaction tasks, and the plurality of business processes can process the plurality of transaction tasks in parallel, so that the parallel processing capability of batch transaction tasks is provided. The plurality of transaction tasks can be distributed into a plurality of business processes, and the plurality of business processes can jointly process the plurality of transaction tasks, so that high concurrency and high availability of a transaction processing process are realized.
FIG. 4 schematically illustrates a flow chart for determining a transaction task corresponding to a transaction request according to an embodiment of the disclosure.
As shown in fig. 4, the determining of the plurality of transaction tasks corresponding to the plurality of transaction requests of the embodiment includes operations S410 to S440.
In operation S410, a plurality of transaction requests are assigned to at least one resolver based on the identified at least one communication protocol.
In operation S420, the plurality of transaction requests are parsed by the at least one parser, and a plurality of messages corresponding to the plurality of transaction requests are obtained.
In operation S430, the plurality of packets are verified, and at least one packet passing the verification is obtained.
In operation S440, at least one transaction task corresponding to the at least one message passing the verification is determined, respectively.
In the disclosed embodiment, each parser is used for parsing the transaction request corresponding to a communication protocol through a preset decoding rule. The multiple resolvers can perform parallel resolution on the multiple transaction requests to obtain the message of each transaction request. Those skilled in the art will appreciate that a "parser" may be a program written in compliance with an application program interface specification. Such as a parsing plug-in. The parser may select a decoding rule for parsing the communication protocol according to an application scenario.
A message may be understood as a unit for exchanging and transmitting data in a network, and may also be understood as a data block. The message includes the specific content of the transaction request. Such as an action requested for the resource, a request URL, a version and status code of the message, and so forth.
The format of the message is usually not fixed. In order to facilitate the analysis of the contents of a large number of messages, the formats of the messages can be converted into a uniform preset data format before the plurality of messages are verified. The message used in the system can be converted into a uniform format in the system. When the internal message is sent out, the internal message is converted into other formats. For example, external messages are converted to json format, and outgoing messages are converted to xml format.
The process of checking the message can be completed by the route adapter. The routing adapter is provided with a rule for message verification. The routing adapter can acquire the specified content in the message in the form of key value pairs and check the specified content. The checking content comprises one of message length checking, message type checking, message version checking and non-empty checking.
For example, the routing adapter sets the length of the message to be 20 characters. When the length of the message to be verified is 30 characters, the message cannot pass the verification.
For the message which is not verified, the message which is verified can be returned to the corresponding resolver. And reconfiguring the analysis environment for the message which fails to pass the verification so as to analyze the message again.
In the embodiment of the disclosure, both the decoding rule for transaction request analysis and the environment for message analysis can be flexibly configured according to the actual analysis requirement, so as to realize batch processing of various communication protocols and various messages.
FIG. 5 schematically illustrates a flow diagram of scheduling business processes for transaction tasks according to an embodiment of the disclosure.
As shown in fig. 5, the scheduling of at least one business process by the plurality of transaction tasks of this embodiment includes operations S510 to S520.
In operation S510, a plurality of business units respectively corresponding to a plurality of transaction tasks are determined.
In operation S520, at least one service process is scheduled according to the types and the number of the plurality of service units, where each service process is configured to process a preset number and a preset type of service units.
In the disclosed embodiment, each transaction task may be divided into a plurality of service units, and the service unit is the minimum granularity of service division. For example, the transaction task is analyzed, and at least one business unit set corresponding to the transaction task is determined, wherein each business unit set comprises at least one business unit. Understandably, completion of the transaction task requires completion of all business units in at least one of the sets of business units.
For example, the transaction task is to complete the sharing of the commodity, and the transaction task can be divided into a service unit set for acquiring commodity information, a service unit set for processing the commodity information, and a service unit set for sending the commodity information by using the service unit set as the granularity. The service unit of the service unit set for obtaining the commodity information may include obtaining a website for displaying the commodity information, receiving an address of the commodity information, and obtaining a picture of the commodity. The service unit for processing the commodity information set may include encoding a web address and generating a two-dimensional code image from the encoded information. The service unit set for transmitting the commodity information may include compressing the two-dimensional code image and transmitting the compressed data to a receiving address.
And scheduling at least one service process for executing the service units according to the types and the number of the service units after the transaction tasks are divided. Each service process is used for processing a preset number of service units and a preset type of service units. For example, one business process is used to execute 1000 business units. As another example, a business process is used to execute business units of the same type. Based on the number and types of the service units, the service units are distributed to different service processes, so that the reasonable control of the service process execution performance is realized, and the execution process is optimized.
When one or more business processes are scheduled, the parallel processing of the transaction tasks can be realized.
Illustratively, when a plurality of business processes are scheduled, the processing result is obtained by processing a plurality of transaction tasks in parallel by at least one business process, and the processing result comprises: and determining a main transaction task of at least one transaction task executed in each business process and an associated sub-transaction task of the main transaction task. And executing the corresponding main transaction task and the associated subtask in parallel in a plurality of business processes to obtain an execution state. And obtaining a processing result according to the execution state.
Illustratively, when a business process is scheduled, a plurality of transaction tasks are processed in parallel through at least one business process to obtain a processing result, and the business process is used for processing at least one transaction task in batches and comprises the following steps: determining a main transaction task of at least one transaction task in a business process and an associated subtask of the main transaction task; executing the main transaction task and the associated sub transaction tasks in parallel at a plurality of task points of the business process to obtain an execution state; and obtaining a processing result according to the execution state.
Each business process is used to batch process multiple transaction tasks. Before each business process processes the transaction tasks, a main task and a subtask associated with the main task in the transaction tasks are determined, and then business units corresponding to each task are added into an execution queue and are sequentially executed.
When a plurality of transaction tasks are processed by a plurality of business processes, the plurality of business processes can be executed in parallel. When a plurality of transaction tasks are processed by one business process, the plurality of transaction tasks are executed in parallel by a plurality of task points in the business process.
FIG. 6 schematically shows a flow chart for obtaining processing results according to an embodiment of the disclosure.
As shown in fig. 6, the present embodiment includes operations S610 to S620 to obtain a processing result according to the execution state.
In operation S610, an execution log is initialized.
In operation S620, the execution status of each transaction task is sequentially updated in the execution log according to the execution order of the plurality of transaction tasks, resulting in a processing result.
In the disclosed embodiment, the execution log is used to record the execution status of each transaction task. The execution status includes success, failure, and not explicit. And when the transaction task is executed and returns to the success state, updating the execution state of the transaction task to be successful in the execution log. And when the transaction task is executed and returns to the failure state, updating the execution state of the transaction task to be failure in the execution log. And when the transaction task is executed and returns to the undefined state, updating the execution state of the transaction task to be undefined in the execution log.
It should be noted that, when the execution status is successful, it is further necessary to determine whether the transaction task is the last transaction task in the execution queue. And under the condition that the transaction task is determined to be the last transaction task in the execution queue, obtaining a final processing result. And when the execution state is failure, terminating the execution queue, returning the result of the failure of the execution, and waiting for rescheduling. And when the execution state is unknown, terminating the execution queue, returning the result of execution failure, and waiting for rescheduling.
Fig. 7 schematically shows a flow chart of a transaction processing method according to another embodiment of the present disclosure.
As shown in fig. 7, the embodiment further includes operation S710 on the basis of operations S310 to S340 according to the transaction processing method.
In operation S710, in case that it is determined that the plurality of business processes are performed in the plurality of applications, the processing of the plurality of transaction requests is completed in the plurality of applications by sending the online request, resulting in a processing result.
In the embodiment of the present disclosure, in a case where a plurality of business processes need to be executed in a plurality of applications, an online request needs to be sent to the plurality of applications. The online request is used for requesting a plurality of application programs to jointly execute a plurality of business processes. For example, in the process of completing a payment transaction, the first application receives a transaction request and completes the task of identifying the payer identity, payee identity and merchandise information in the transaction request, but the first application cannot provide services for financial payment. Therefore, the first application program initiates an online request to the second application program, and the second application program completes the payment process, including the transaction tasks of the verification of the user account number and the password, the verification of the payment environment and the like.
The transaction processing method provided by the disclosure can be independently applied to a back-end system, transaction processing under a non-interface interaction scene is completed, analysis of the back-end system and the front-end system is realized, and the volume of a distributed system is reduced. In addition, the multiple communication protocols are analyzed based on the Netty framework and the Dubbo framework, and data transmission is carried out based on the thread models of the NIO and the AIO, so that high availability and high concurrency of the distributed system are realized.
Based on the transaction processing method, the disclosure also provides a transaction processing device. The apparatus will be described in detail below with reference to fig. 8.
Fig. 8 schematically shows a block diagram of the structure of a transaction processing device according to an embodiment of the present disclosure.
As shown in fig. 8, the transaction processing apparatus 800 of this embodiment includes an acquisition module 810, an identification module 820, a first determination module 830, and a scheduling module 840.
The obtaining module 810 is configured to obtain a plurality of transaction requests. In an embodiment, the obtaining module 810 may be configured to perform the operation S310 described above, which is not described herein again.
The identification module 820 is configured to identify at least one communication protocol included in the plurality of transaction requests. In an embodiment, the identifying module 820 may be configured to perform the operation S320 described above, which is not described herein again.
The first determining module 830 is configured to determine a plurality of transaction tasks corresponding to a plurality of transaction requests according to at least one preset decoding rule, where the at least one decoding rule corresponds to at least one communication protocol. In an embodiment, the first determining module 830 may be configured to perform the operation S330 described above, and is not described herein again.
The scheduling module 840 is configured to schedule at least one service process for the multiple transaction tasks, so as to perform parallel processing on the multiple transaction tasks through the at least one service process to obtain a processing result, where the service process is configured to process at least one transaction task in batch. In an embodiment, the scheduling module 840 may be configured to perform the operation S340 described above, which is not described herein again.
According to an embodiment of the present disclosure, the first determining module includes: the distribution unit is used for distributing a plurality of transaction requests to at least one parser based on the identified at least one communication protocol, and each parser is used for parsing the transaction requests corresponding to one communication protocol through one preset decoding rule; the analysis unit is used for analyzing the transaction requests through at least one analyzer to obtain a plurality of messages corresponding to the transaction requests; the verification unit is used for verifying the plurality of messages to obtain at least one verified message; and the first determining unit is used for respectively determining at least one transaction task corresponding to at least one message passing the verification.
According to an embodiment of the disclosure, the determining module further comprises: and the conversion unit is used for converting the formats of the messages into a preset data format before the plurality of messages are verified to obtain at least one message passing the verification.
According to an embodiment of the present disclosure, the scheduling module includes: the second determining unit is used for determining a plurality of business units respectively corresponding to the plurality of transaction tasks; and the scheduling unit is used for scheduling at least one service process according to the types and the number of the plurality of service units, and each service process is used for processing the service units with preset number and preset types.
According to an embodiment of the present disclosure, the at least one business process includes a plurality of business processes, and the scheduling module includes: the third determining unit is used for determining a main transaction task of at least one transaction task executed in each business process and an associated sub-transaction task of the main transaction task; the first execution unit is used for executing the corresponding main transaction task and the associated subtask in parallel in a plurality of business processes to obtain an execution state; and a first obtaining unit configured to obtain a processing result according to the execution state.
According to an embodiment of the present disclosure, the at least one business process includes one business process, and the scheduling module includes: the fourth determining unit is used for determining a main transaction task of at least one transaction task in the business process and an associated subtask of the main transaction task; the second execution unit is used for executing the main transaction task and the associated sub-transaction tasks in parallel at a plurality of task points of the business process to obtain an execution state; and a second obtaining unit configured to obtain a processing result according to the execution state.
According to an embodiment of the present disclosure, the obtaining unit includes: the initialization unit is used for initializing an execution log, and the execution log is used for recording the execution state of each transaction task; and the updating unit is used for sequentially updating the execution state of each transaction task in the execution log according to the execution sequence of the transaction tasks to obtain a processing result.
According to an embodiment of the present disclosure, the apparatus further comprises: the second determining module is used for completing the processing of the transaction requests in the application programs by sending the online request under the condition that the business processes are determined to be executed and completed in the application programs, so that a processing result is obtained; the online request is used for requesting a plurality of application programs to jointly execute a plurality of business processes.
According to an embodiment of the present disclosure, any plurality of the obtaining module 810, the identifying module 820, the first determining module 830, and the scheduling module 840 may be combined into one module to be implemented, or any one of the modules may be split into a plurality of modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of the other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the obtaining module 810, the identifying module 820, the first determining module 830 and the scheduling module 840 may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or in any one of three implementations of software, hardware and firmware, or in any suitable combination of any of them. Alternatively, at least one of the obtaining module 810, the identifying module 820, the first determining module 830 and the scheduling module 840 may be at least partially implemented as a computer program module, which when executed may perform a corresponding function.
Fig. 9 schematically shows a block diagram of an electronic device adapted to implement a transaction processing method according to an embodiment of the present disclosure.
As shown in fig. 9, an electronic apparatus 900 according to an embodiment of the present disclosure includes a processor 901 which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)902 or a program loaded from a storage portion 908 into a Random Access Memory (RAM) 903. Processor 901 may comprise, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 901 may also include on-board memory for caching purposes. The processor 901 may comprise a single processing unit or a plurality of processing units for performing the different actions of the method flows according to embodiments of the present disclosure.
In the RAM 903, various programs and data necessary for the operation of the electronic apparatus 900 are stored. The processor 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. The processor 901 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 902 and/or the RAM 903. Note that the programs may also be stored in one or more memories other than the ROM 902 and the RAM 903. The processor 901 may also perform various operations of the method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
Electronic device 900 may also include input/output (I/O) interface 905, input/output (I/O) interface 905 also connected to bus 904, according to an embodiment of the present disclosure. The electronic device 900 may also include one or more of the following components connected to the I/O interface 905: an input portion 906 including a keyboard, a mouse, and the like; an output section 907 including components such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 908 including a hard disk and the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as necessary. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 910 as necessary, so that a computer program read out therefrom is mounted into the storage section 908 as necessary.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to embodiments of the present disclosure, a computer-readable storage medium may include the ROM 902 and/or the RAM 903 described above and/or one or more memories other than the ROM 902 and the RAM 903.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the method illustrated in the flow chart. When the computer program product runs in a computer system, the program code is used for causing the computer system to realize the item recommendation method provided by the embodiment of the disclosure.
The computer program performs the above-described functions defined in the system/apparatus of the embodiments of the present disclosure when executed by the processor 901. The systems, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In one embodiment, the computer program may be hosted on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed in the form of a signal on a network medium, and downloaded and installed through the communication section 909 and/or installed from the removable medium 911. The computer program containing program code may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 909, and/or installed from the removable medium 911. The computer program, when executed by the processor 901, performs the above-described functions defined in the system of the embodiment of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In accordance with embodiments of the present disclosure, program code for executing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, these computer programs may be implemented using high level procedural and/or object oriented programming languages, and/or assembly/machine languages. The programming language includes, but is not limited to, programming languages such as Java, C + +, python, the "C" language, or the like. The program code may execute entirely on the user computing device, partly on the user device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (13)

1. A transaction processing method, comprising:
obtaining a plurality of transaction requests;
identifying at least one communication protocol included in the plurality of transaction requests;
determining a plurality of transaction tasks corresponding to a plurality of transaction requests according to at least one preset decoding rule, wherein the at least one decoding rule corresponds to the at least one communication protocol one by one; and
and scheduling at least one business process for a plurality of transaction tasks so as to process the transaction tasks in parallel through the at least one business process to obtain a processing result, wherein the business process is used for processing at least one transaction task in batch.
2. The method of claim 1, wherein the determining a plurality of transaction tasks corresponding to a plurality of transaction requests according to at least one preset decoding rule comprises:
based on the identified at least one communication protocol, distributing the transaction requests to at least one parser, wherein each parser is used for parsing the transaction requests corresponding to one communication protocol through a preset decoding rule;
analyzing the plurality of transaction requests through the at least one analyzer to obtain a plurality of messages corresponding to the plurality of transaction requests;
checking the plurality of messages to obtain at least one message passing the checking; and
and respectively determining at least one transaction task corresponding to the at least one message passing the verification.
3. The method of claim 2, wherein the check comprises one of a message length check, a message type check, a message version check, and a non-null check.
4. The method of claim 2, wherein before said checking said plurality of packets to obtain at least one packet that passes said checking, further comprising:
and converting the formats of the messages into preset data formats.
5. The method of claim 1, wherein said scheduling at least one business process for a plurality of transaction tasks comprises:
determining a plurality of business units respectively corresponding to the plurality of transaction tasks; and
and scheduling at least one service process according to the types and the number of the plurality of service units, wherein each service process is used for processing the service units with preset number and preset types.
6. The method of claim 1, wherein the at least one business process comprises a plurality of business processes, the plurality of transaction tasks are processed in parallel by the at least one business process to obtain a processing result, and the business process is configured to batch process at least one of the transaction tasks, and comprises:
determining a main transaction task of at least one transaction task executed in each business process and an associated sub-transaction task of the main transaction task;
executing the corresponding main transaction task and the associated subtask in parallel in a plurality of business processes to obtain an execution state; and
and obtaining a processing result according to the execution state.
7. The method of claim 1, wherein the at least one business process comprises a business process, and the parallel processing of the plurality of transaction tasks by the at least one business process results in a processing result, and the business process is configured to batch process at least one of the transaction tasks, and comprises:
determining a main transaction task of at least one transaction task in the business process and an associated subtask of the main transaction task;
executing the main transaction task and the associated sub transaction tasks in parallel at a plurality of task points of the business process to obtain an execution state; and
and obtaining a processing result according to the execution state.
8. The method of claim 6 or 7, wherein said deriving a processing result from said execution state comprises:
initializing an execution log, wherein the execution log is used for recording the execution state of each transaction task; and
and according to the execution sequence of the transaction tasks, sequentially updating the execution state of each transaction task in the execution log to obtain a processing result.
9. The method of claim 1, wherein the method further comprises: under the condition that the plurality of business processes are determined to be executed and completed in a plurality of application programs, processing the plurality of transaction requests in the plurality of application programs by sending online requests to obtain processing results;
wherein the online request is used for requesting the plurality of application programs to jointly execute the plurality of business processes.
10. A transaction processing device comprising:
an acquisition module for acquiring a plurality of transaction requests;
an identification module to identify at least one communication protocol included in the plurality of transaction requests;
the first determining module is used for determining a plurality of transaction tasks corresponding to a plurality of transaction requests according to at least one preset decoding rule, wherein the at least one decoding rule corresponds to the at least one communication protocol one by one; and
the scheduling module is used for scheduling at least one business process for a plurality of transaction tasks so as to perform parallel processing on the transaction tasks through the at least one business process to obtain a processing result, and the business process is used for processing at least one transaction task in batches.
11. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-9.
12. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to perform the method of any one of claims 1 to 9.
13. A computer program product comprising a computer program which, when executed by a processor, implements a method according to any one of claims 1 to 9.
CN202111310243.1A 2021-11-05 2021-11-05 Transaction processing method, apparatus, electronic device, storage medium, and program product Pending CN113989046A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111310243.1A CN113989046A (en) 2021-11-05 2021-11-05 Transaction processing method, apparatus, electronic device, storage medium, and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111310243.1A CN113989046A (en) 2021-11-05 2021-11-05 Transaction processing method, apparatus, electronic device, storage medium, and program product

Publications (1)

Publication Number Publication Date
CN113989046A true CN113989046A (en) 2022-01-28

Family

ID=79746922

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111310243.1A Pending CN113989046A (en) 2021-11-05 2021-11-05 Transaction processing method, apparatus, electronic device, storage medium, and program product

Country Status (1)

Country Link
CN (1) CN113989046A (en)

Similar Documents

Publication Publication Date Title
CN111768322A (en) Charitable service platform system
CN112288577A (en) Transaction processing method and device for distributed service, electronic equipment and medium
CN111950249A (en) Message generation method and device, electronic equipment and storage medium
CN115357761A (en) Link tracking method and device, electronic equipment and storage medium
CN114022031A (en) Data processing method, data processing apparatus, electronic device, medium, and computer program product
CN113132400B (en) Business processing method, device, computer system and storage medium
CN115170321A (en) Method and device for processing batch transaction data
CN116561013B (en) Testing method and device based on target service framework, electronic equipment and medium
CN115374207A (en) Service processing method and device, electronic equipment and computer readable storage medium
CN114546370A (en) Data docking method and related device
CN113989046A (en) Transaction processing method, apparatus, electronic device, storage medium, and program product
CN112182400B (en) Message processing method, message processing device, electronic equipment and storage medium
CN113656782A (en) Method for aggregating identification codes, device for aggregating identification codes and electronic equipment
CN114138712A (en) File processing method, processing device, electronic equipment and storage medium
CN110378785B (en) Transaction processing method, apparatus, computing device and medium executed by server
CN113992641A (en) Data processing method, device, equipment and storage medium
CN113448578A (en) Page data processing method, processing system, electronic device and readable storage medium
CN113590243A (en) Energy enterprise project creation method and device, computer equipment and medium
CN114202046B (en) Method, device, equipment and medium for generating two-dimension code based on SAP system
CN111949472A (en) Method and device for recording application logs
CN116645245A (en) Electronic signing method, image generating method, device, equipment and medium
CN116012158A (en) Service processing method, device, equipment and storage medium
CN117726458A (en) Information processing method, device, equipment and storage medium
CN114240437A (en) Service processing method, service processing device, electronic equipment and readable storage medium
CN115423448A (en) Service processing 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