CN111652728B - Transaction processing method and device - Google Patents

Transaction processing method and device Download PDF

Info

Publication number
CN111652728B
CN111652728B CN202010551815.4A CN202010551815A CN111652728B CN 111652728 B CN111652728 B CN 111652728B CN 202010551815 A CN202010551815 A CN 202010551815A CN 111652728 B CN111652728 B CN 111652728B
Authority
CN
China
Prior art keywords
blockchain
node
application service
block chain
blockchain node
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
CN202010551815.4A
Other languages
Chinese (zh)
Other versions
CN111652728A (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.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202010551815.4A priority Critical patent/CN111652728B/en
Publication of CN111652728A publication Critical patent/CN111652728A/en
Application granted granted Critical
Publication of CN111652728B publication Critical patent/CN111652728B/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Landscapes

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

Abstract

The application relates to the field of financial science and technology (Fintech), and discloses a transaction processing method and device, wherein the method comprises the following steps: the proxy application service receives a transaction request of the blockchain application service; the agent application service is respectively connected with N block chain link points in the block chain network; n is a positive integer; the proxy application service determines a first blockchain node from the N blockchain nodes; the proxy application service sends a transaction request to the blockchain network through the first blockchain link point. The technical scheme is beneficial to reducing the requirements of the blockchain application system on application services.

Description

Transaction processing method and device
Technical Field
The embodiment of the application relates to the field of financial science and technology (Fintech), in particular to a transaction processing method and device.
Background
With the development of computer technology, more and more technologies are applied in the financial field, and the traditional financial industry is gradually changed to the financial technology (Fintech), but due to the requirements of safety and real-time performance of the financial industry, the requirements of the technology are also higher.
The blockchain (Blockchain) application system refers to a software system formed by applying the blockchain technology to a specific business scene and combining the characteristics of the blockchain, such as non-tamperable, distributed account book, non-repudiation and the like. In a blockchain application system, after generating a transaction request, a blockchain application service sends the transaction request to a blockchain node in a blockchain network, and the blockchain node broadcasts the transaction request to the whole blockchain network.
However, in this manner, the blockchain application service needs to record node information corresponding to the blockchain link points, and needs to determine to which blockchain node the transaction request is sent according to the node information corresponding to the blockchain node. As such, the blockchain application system has a high demand for blockchain application services.
Disclosure of Invention
The embodiment of the application provides a transaction processing method and a transaction processing device, which are beneficial to reducing the requirements of a blockchain application system on blockchain application services.
The transaction processing method provided by the embodiment of the application comprises the following steps:
the proxy application service receives a transaction request of the blockchain application service; the agent application service is respectively connected with N block chain link points in the block chain network; n is a positive integer; the proxy application service determining a first blockchain node from the N blockchain nodes; the proxy application service sends the transaction request to the blockchain network through the first blockchain link point.
In an alternative implementation, the proxy application service determines a first blockchain node from the N blockchain nodes, including: the proxy application service obtains a node registration record; the node registration record comprises node information corresponding to each block link point; and the proxy application service determines the first blockchain node according to the node information corresponding to the N blockchain link points.
In an alternative implementation manner, the node information corresponding to each block link point includes an operation state of the block chain node and a processed transaction number of the block chain node; the proxy application service determining the first blockchain node according to node information corresponding to the N blockchain link points, including: the proxy application service determines a blockchain node which is in a normal running state and has the minimum number of processed transactions from the N blockchain nodes as the first blockchain node.
In an alternative implementation, the method further includes: for any one of the N blockchain nodes, performing the following operations: the proxy application service determines heartbeat information of the blockchain node in a preset period; and the proxy application service updates the running state of the blockchain node according to the heartbeat information.
In an alternative implementation, after the proxy application service determines the first blockchain node from the N blockchain nodes, the method further includes: the proxy application service increases the number of processed transactions for the first blockchain node.
In an alternative implementation, the method further includes: the agent application service determines a newly added second block chain node in the block chain link points according to node record information; and the proxy application service establishes connection with the second block chain node and updates node information corresponding to the second block chain node in the node record information.
In an optional implementation manner, the updating the node information corresponding to the second blockchain node in the node record information includes: the proxy application service determines the running state of the second blockchain node according to the heartbeat information of the second blockchain node; the proxy application service sets the number of processed transactions for the second blockchain node to an initial value.
In the above technical solution, the blockchain application service generates a transaction request, sends the transaction request to the proxy application service, determines the first blockchain node by the proxy application service, and sends the transaction request to the first blockchain node. The block chain application service does not need to record node information corresponding to the block chain link points and also does not need to determine the first block chain node, thereby being beneficial to reducing the requirements of the block chain application system on the block chain application service.
Correspondingly, the embodiment of the application also provides a transaction processing device, which comprises:
A processing unit and a receiving and transmitting unit;
The receiving and transmitting unit is used for receiving a transaction request of the blockchain application service; the receiving and transmitting units are respectively connected with N block chain link points in the block chain network; n is a positive integer;
the processing unit determining a first blockchain node from the N blockchain nodes;
The transceiver unit sends the transaction request to the blockchain network through the first blockchain link point.
In an alternative implementation manner, the processing unit is specifically configured to: acquiring a node registration record; the node registration record comprises node information corresponding to each block link point; and determining the first block chain node according to the node information corresponding to the N block chain link points.
In an alternative implementation manner, the node information corresponding to each block link point includes an operation state of the block chain node and a processed transaction number of the block chain node; the processing unit is specifically configured to: and determining the blockchain node which is in a normal running state and has the minimum number of processed transactions from the N blockchain nodes as the first blockchain node.
In an alternative implementation, the processing unit is further configured to: for any one of the N blockchain nodes, performing the following operations: determining heartbeat information of the block chain node in a preset period; and updating the running state of the blockchain node according to the heartbeat information.
In an alternative implementation, the processing unit is further configured to: the number of processed transactions for the first blockchain node is increased.
In an alternative implementation, the processing unit is further configured to: determining a newly added second block chain node in the block chain link points according to the node record information; and establishing connection with the second block chain node, and updating node information corresponding to the second block chain link point in the node record information.
In an alternative implementation manner, the processing unit is specifically configured to: determining the running state of the second blockchain node according to the heartbeat information of the second blockchain node; the number of processed transactions for the second blockchain node is set to an initial value.
Accordingly, an embodiment of the present application further provides a computing device, including:
A memory for storing program instructions;
and the processor is used for calling the program instructions stored in the memory and executing the transaction processing method according to the obtained program.
Accordingly, an embodiment of the present application further provides a computer-readable nonvolatile storage medium, including computer-readable instructions, which when read and executed by a computer, cause the computer to perform the transaction processing method described above.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a system architecture according to the present application;
FIG. 2 is a schematic diagram of another system architecture according to the present application;
FIG. 3 is a schematic flow chart of a transaction processing method according to the present application;
FIG. 4 is a schematic flow chart of processing a transaction request based on load balancing according to the present application;
FIG. 5 is a flow chart illustrating a method for monitoring the operational status of a blockchain node in accordance with the present application;
FIG. 6 is a schematic diagram of a proxy application service according to the present application;
fig. 7 is a schematic structural diagram of a transaction processing device according to the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be described in further detail below with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
For a better understanding of the present application, the following terms are explained first:
blockchain: a novel distributed infrastructure and computing method for verifying and storing data by using a block chain type data structure, generating and updating data by using a distributed node consensus algorithm, ensuring the safety of data transmission and access by using a cryptography mode, and programming and operating the data by using an intelligent contract consisting of an automatic script code.
Blockchain nodes: the process of providing blockchain services runs on a server or cloud environment. Typically, a server may run one or more blockchain nodes.
A blockchain application system: the blockchain technology is applied to a specific business scene, and the characteristics of the blockchain, such as non-falsification, distributed account book, non-repudiation and the like are combined, so that the software system is formed.
Intelligent contract: a computer program or code segment running on a blockchain. The smart contract may be automatically executed when a certain source code condition is satisfied.
Service registration: a directory service provides registration and registration functions for services, and is beneficial to definition of services, selection of services and management of services.
Service agent: a service request may be communicated with a real service through a service proxy. The service agents may mask compatibility and complexity between services, provide load balancing capabilities, and the like.
Load balancing: for distributing loads among multiple computers (clusters of computers), network connections, CPUs, disk drives, or other resources for purposes of optimizing resource usage, maximizing throughput, minimizing response time, and avoiding overload.
Existing blockchain application systems include a blockchain application service and a blockchain network, the blockchain application service being connected to a plurality of blockchain link points in the blockchain network. The block chain application service records node information corresponding to all block chain link points connected with the block chain application service in the block chain network.
After generating the transaction request, the blockchain application service determines to send the transaction request to a blockchain node connected with the blockchain application service in the blockchain network, and then the blockchain node broadcasts the transaction request to the whole blockchain network.
FIG. 1 illustrates a deployment diagram of a blockchain application system. The blockchain application service is connected with 2 blockchain nodes (namely, a blockchain node 1 and a blockchain node 2) in the blockchain network, and node information of the blockchain node 1 and node information of the blockchain node 2 are recorded in the blockchain application service.
Illustratively, the blockchain application service, upon generating a transaction request, sends the transaction request to blockchain node 1, which blockchain node 1 broadcasts the transaction request to the entire blockchain network.
It can be seen that the blockchain application service needs to record node information corresponding to all blockchain nodes connected with the blockchain application service in the blockchain network, determine a blockchain node from the blockchain nodes according to the node information corresponding to the blockchain nodes, and send a transaction request to the blockchain node.
As such, the blockchain application system has a high demand for blockchain application services.
In order to solve the above technical problems, fig. 2 is a schematic diagram for schematically illustrating the deployment of another blockchain application system provided by the present application. The blockchain application system comprises a blockchain application service, a proxy application service and a blockchain network, wherein the blockchain application service is connected with the proxy application service, and the proxy application service is connected with a plurality of blockchain link points in the blockchain network.
The proxy application service records node information corresponding to all the block link points connected with the proxy application service in the block chain network. After generating the transaction request, the blockchain application service sends the transaction request to the proxy application service, and the proxy application service determines to send the transaction request to a blockchain node connected with the proxy application service in the blockchain network, so that the blockchain node broadcasts the transaction request to the whole blockchain network.
Illustratively, as in FIG. 2, the proxy application service is connected to 2 blockchain nodes (blockchain node 1, blockchain node 2) in the blockchain network, and the node information of blockchain node 1, the node information of blockchain node 2 are recorded in the proxy application service. After generating the transaction request, the blockchain application service sends the transaction request to the proxy application service, and the proxy application service determines to send the transaction request to the blockchain node 1, then the blockchain node 1 broadcasts the transaction request to the entire blockchain network.
In an alternative implementation, the proxy application service and the blockchain application service may be in a one-to-one correspondence, i.e., one proxy application service corresponds to one blockchain application service. When the proxy application service is connected to the blockchain network, the proxy application service may specifically be connected to a blockchain node in the blockchain network that has previously been connected to the blockchain application service. In connection with FIG. 1, when a blockchain application service is connected to blockchain node 1 and blockchain node 2 in a blockchain network, the proxy application service may be connected to blockchain node 1 and blockchain node 2 in the blockchain network.
In connection with the blockchain application system as shown in fig. 2, the present application provides a transaction processing method that helps to reduce the requirements of the blockchain application system for blockchain application services. The transaction processing method may be performed by a proxy application service, a blockchain application service, and a blockchain network.
The proxy application service may also be referred to as a generic service, a blockchain generic service, etc., and the blockchain application service may also be referred to as an application service, a business service, a blockchain application service, etc.
The proxy application service and the blockchain application service may be two services deployed on the same server or two services deployed on different servers.
Referring to fig. 3, the following describes a flow of the transaction processing method provided by the present application.
In step 301, a blockchain application service generates a transaction request.
Wherein the transaction request is a transaction request to be sent to a blockchain network.
The blockchain application service may be software or an application deployed in the business system, and when a business person needs to send a transaction request to the blockchain network, the blockchain application service may issue an instruction to the blockchain application service deployed on the business system, and the blockchain application service generates the transaction request according to the received instruction.
In step 302, the blockchain application service sends a transaction request to the proxy application service.
Accordingly, the proxy application service receives a transaction request from the blockchain application service.
In one alternative, the proxy application service is connected to N block link points in the block chain network, respectively, where N is a positive integer. Node information corresponding to each block link point in the N block link nodes is recorded in the proxy application service. Illustratively, the node information corresponding to each blockchain node includes an operating state of the blockchain node and a number of transactions processed.
The running state of the blockchain node comprises normal and abnormal, when the running state of the blockchain node is normal, the blockchain node can receive a transaction request from the proxy application service, namely the blockchain node is in an available state, and the blockchain node can be called as the available blockchain node; when the operation state of the blockchain node is abnormal, the blockchain node cannot receive a transaction request from the proxy application service, that is, the blockchain node is in an unavailable state, and the blockchain node can be called as an unavailable blockchain node.
In addition, the node information corresponding to each block link point may further include connection information and latest change time of the block link node. Specifically, the connection information of the blockchain node may be an IP address and a port (computer port) of the blockchain node; the latest change time of the blockchain node may be the last change time of the node information corresponding to the blockchain node.
In an optional manner, the proxy application service includes a node registration record, where node information corresponding to each block link point in the N block chain nodes is recorded in the node registration record.
For example, the proxy application service is connected to the blockchain nodes 1 to 5 in the blockchain network, and includes a node registration record in the proxy application service, where node information corresponding to each blockchain node 1 to 5 is recorded in the node registration record.
The node registration record may be, for example, a list of nodes. Table 1 is a node list provided in the embodiment of the present application, where node information corresponding to a block link point is recorded in the node list, and the node information includes an operation state of the block link node, a processed transaction number, connection information, and a latest change time.
TABLE 1
Operating state Number of processed transactions Connection information Time of latest change
Blockchain node 1 Normal state 10 IP1+port1 T1
Blockchain node 2 Normal state 12 IP2+port2 T2
Blockchain node 3 Abnormality of 14 IP3+port3 T3
Blockchain node 4 Normal state 5 IP4+port4 T4
Blockchain node 5 Abnormality of 9 IP5+port5 T5
The proxy application service determines a first blockchain node from the N blockchain nodes, step 303.
The proxy application service obtains a node registration record; the proxy application service determines a first blockchain node according to node information corresponding to the N blockchain link points.
In one implementation, the first blockchain node is in a normal operating state, and the number of transactions processed by the first blockchain node meets a number of transactions processed condition. Illustratively, the processed transaction number condition is that the processed transaction number is less than a processed transaction number threshold, or the processed transaction number condition is that the processed transaction number in the node information corresponding to the block link point is the least.
In one implementation, the proxy application service may determine M blockchain nodes in a normal operating state according to an operating state of each of the N blockchain nodes; and then determining the blockchain node with the least processed transaction number as the first blockchain node according to the processed transaction number of each blockchain node in the M blockchain nodes. Wherein M is less than or equal to N, and M is a positive integer.
Taking table 1 as an example, the proxy application service may determine the blockchain node 1, the blockchain node 2, and the blockchain node 4 in a normal operation state according to the operation states of the blockchain nodes from the blockchain node 1 to the blockchain node 5; the proxy application service determines the number of transactions processed for each of blockchain nodes 1, 2, and 4, determines that the blockchain node in which the number of transactions processed is the least is blockchain node 4, thereby determining blockchain node 4 as the first blockchain node.
The proxy application service, when determining the first blockchain node from the M blockchain nodes in the normal running state, may determine, as the first blockchain node, a blockchain node with the least number of processed transactions among the M blockchain nodes based on a load balancing algorithm, which helps to balance the number of processed transactions processed by the M blockchain nodes.
Exemplary, embodiments of the present application provide a flow chart for a blockchain application system to process transaction requests based on load balancing as shown in fig. 4.
Step 401, the proxy application service receives a transaction request;
Step 402, the proxy application service determines a first blockchain node according to a load balancing algorithm;
step 403, the proxy application service sending a transaction request to the first blockchain node;
the first blockchain node processes the transaction request, step 404.
The proxy application service sends 304 a request for a transaction to the first block link point.
After the first block link point receives the transaction request, the transaction request is broadcast to the block chain network, so that the agent application service sends the transaction request to the block chain network through the first block link point.
In addition, the proxy application service may increase the number of transactions processed for the first blockchain node in the node information corresponding to the first blockchain node. Taking table 1 as an example, when the proxy application service determines the blockchain node 4 as the first blockchain node, the proxy application service adds 1 to the number of processed transactions of the blockchain node 4 in the node information corresponding to the blockchain node 4, that is, the number of processed transactions of the blockchain node 4 is 6.
In the above technical solution, the blockchain application service generates a transaction request, sends the transaction request to the proxy application service, determines the first blockchain node by the proxy application service, and sends the transaction request to the first blockchain node. The block chain application service does not need to record node information corresponding to the block chain link points and also does not need to determine the first block chain node, thereby being beneficial to reducing the requirements of the block chain application system on the block chain application service.
In a specific implementation, the blockchain application service can be deployed in a business system, such as a banking business system, so that the complexity of the blockchain application service in the business system is reduced, and the complexity of the business system is further reduced.
Furthermore, blockchain nodes connected to proxy application services may be dynamically changing. By way of example, the dynamic changes may include any of adding nodes, deleting nodes, restoring node services, disconnecting node services. Accordingly, the node registration record in the proxy application service may be dynamically changed.
In connection with the architecture shown in fig. 2, there may be four cases corresponding to the dynamic change of the blockchain node connected to the proxy application service and the dynamic change of the node registration record:
In case 1, if a newly added block chain node is connected with the proxy application service, node information corresponding to the block chain node is newly added in the node registration record. For example, when a blockchain node 5 is newly added in the blockchain network and the blockchain node 5 is connected with the proxy application service, node information corresponding to the newly added blockchain node 5 can be registered in the node registration record. For another example, when the blockchain node 4 in the blockchain network is connected to the proxy application service, node information corresponding to the blockchain node 4 may be newly added in the node registration record.
In case 2, if a block chain node connected to the proxy application service is deleted, node information corresponding to the block chain node is deleted in the node registration record. For example, deleting blockchain node 2 in the blockchain network, that is, deleting blockchain node 2 from blockchain nodes connected to the proxy application service, may delete node information corresponding to blockchain node 2 in the node registration record. For another example, the blockchain node 2 is deleted from the blockchain node connected to the proxy application service, but the blockchain node 2 is not deleted from the blockchain network, and the node information corresponding to the blockchain node 2 may be deleted in the node registration record.
In case 3, in the plurality of blockchain nodes connected with the proxy application service, if a blockchain node is connected with the proxy application service but operates abnormally, the proxy application service sets the operation state of the blockchain node in the node registration record as abnormal. For example, when the proxy application service detects that the blockchain node 2 is abnormal in operation, the operation state in the node information corresponding to the blockchain node 2 in the node registration record is set to be abnormal.
And 4, if a certain blockchain node is connected with the proxy application service and is recovered to be normal in operation from abnormal operation in a plurality of blockchain nodes connected with the proxy application service, the proxy application service sets the operation state of the blockchain node in the node registration record to be normal. For example, when the proxy application service detects that the blockchain node 2 is recovered from abnormal operation to normal operation, the operation state in the node information corresponding to the blockchain node 2 in the node registration record is set to be normal.
It should be noted that, in case 3 above, it should be understood that the blockchain node is not disconnected from the proxy application service, or the node information corresponding to the blockchain node is not deleted from the node registration record of the proxy application service, and the blockchain node cannot receive the transaction request from the proxy application service. Further, case 4 should understand that when the blockchain node resumes normal operation, the blockchain node may receive a transaction request from the proxy application service, so that the proxy application service may set the operation state in the node information corresponding to the blockchain node to be normal.
In the embodiment of the application, proxy application service can be set to detect the heartbeat information of each of N block chain link points, so that the running state of the block chain nodes in the node information corresponding to each of N block chain nodes is determined according to the heartbeat information of each of N block chain nodes.
Taking any one of N blockchain nodes as an example, the proxy application service determines heartbeat information of the blockchain node in a preset period; and updating the running state of the block chain nodes in the node information corresponding to the block chain nodes according to the heartbeat information.
In the embodiment of the application, if the node information is newly added in the node registration record, the proxy application service can also detect the heartbeat information of the newly added blockchain node. Specifically, the agent application service determines a newly added second blockchain node in the blockchain link points according to the node record information; the proxy application service establishes connection with the second block chain node and updates node information corresponding to the second block chain link point in the node record information.
The proxy application service may determine an operational state of the second blockchain node based on heartbeat information of the second blockchain node and set a processed transaction number of the second blockchain node to an initial value. Illustratively, the number of processed transactions for the second blockchain node is set to an initial value of 0.
Exemplary, fig. 5 is a schematic flow chart provided in an embodiment of the present application, where the flow is executed by the proxy application service as follows:
step 501, obtaining a node registration record;
Step 502, judging whether node information corresponding to a newly added block link point exists in a node registration record; if yes, go to step 503, otherwise, go to step 504;
Step 503, establishing heartbeat connection for the newly added blockchain node;
Step 504, receiving heartbeat information of each block chain node in the N block chain nodes according to the heartbeat duration;
Step 505, judging whether heartbeat information of N block chain nodes is received; if yes, go to step 506, otherwise go to step 508;
Step 506, judging whether a blockchain node with an abnormal running state exists in the node registration record, if yes, executing step 507, otherwise, executing step 501;
step 507, setting the running state of the blockchain node with abnormal running state in the node registration record as normal;
Step 508, judging whether the running state of the blockchain node which does not receive the heartbeat information in the node registration record is normal; if yes, go to step 509, otherwise go to step 501;
Step 509, setting the running state of the blockchain node which does not receive the heartbeat information in the node registration record as abnormal.
In the technical scheme, heartbeat connection with N blockchain nodes is established in the proxy application service, and heartbeat information of each blockchain node in the N blockchain nodes is acquired, so that the running states of the N blockchain nodes are determined and updated into the node registration record, the running states of the N blockchain nodes in the node registration record are maintained to be the latest running states, and the proxy application service is prevented from sending a transaction request to the blockchain nodes in abnormal running states.
Further, when detecting that the node registration record has newly added node information, the proxy application service can perform heartbeat detection on the newly added blockchain node corresponding to the newly added node information, and timely update the running state of the newly added blockchain node to the node registration record.
Based on the same inventive concept, fig. 6 schematically illustrates a structural diagram of a proxy application service provided by an embodiment of the present application. The proxy application service may include a node registration record 601, load balancing 602, node listening 603, and transaction request proxy 604.
Illustratively, the node registration record 601 is configured to store N node information corresponding to N blockchain nodes respectively.
The node monitor 603 is configured to obtain N node information corresponding to N blockchain nodes of the node registration record 601, respectively. The node monitor 603 is further configured to communicate with N blockchain nodes, detect heartbeat information of the N blockchain nodes, and further determine whether the blockchain link point is in a normal running state. When a block chain node abnormality causes the block chain link snack hop to timeout, the node monitor 603 updates the running state of the block chain node in the node registration record 601 to be abnormal. And after the newly added blockchain node or the blockchain node in the abnormal operation state resumes the heartbeat, updating the operation state of the blockchain node to be normal.
The load balancing 602 is configured to obtain an available node record of the node registration record 601, and determine, according to the number of processed transactions in the node information corresponding to each block link point in the available node record, a blockchain node (i.e., a first blockchain node) whose number of processed transactions meets the condition of the number of processed transactions.
The transaction request agent 604 is configured to receive a transaction request from a blockchain application service and send the transaction request to a first blockchain node. The transaction request agent 604 is also operable to update the number of processed transactions for the first blockchain node.
In the embodiment of the application, the block chain application service and the block chain network are decoupled through the proxy application service, so that the block chain application service does not directly interact with the block chain network, and the access address of the proxy application service is fixed, so that the block chain application service is not influenced no matter how the block chain nodes in the block chain network change, and the normal operation of the block chain application service is ensured.
Fig. 7 illustrates, based on the same inventive concept, a structure of a transaction processing device according to an embodiment of the present application, which can perform a flow of a transaction processing method.
A processing unit 701 and a transmitting/receiving unit 702;
the transceiver unit 702 is configured to receive a transaction request of a blockchain application service; the transceiver unit 702 is connected to N block link points in the block chain network respectively; n is a positive integer;
The processing unit 701 determines a first blockchain node from the N blockchain nodes;
the transceiver unit 702 sends the transaction request to the blockchain network through the first blockchain link point.
In an alternative implementation manner, the processing unit 701 is specifically configured to: acquiring a node registration record; the node registration record comprises node information corresponding to each block link point; and determining the first block chain node according to the node information corresponding to the N block chain link points.
In an alternative implementation manner, the node information corresponding to each block link point includes an operation state of the block chain node and a processed transaction number of the block chain node; the processing unit 701 is specifically configured to: and determining the blockchain node which is in a normal running state and has the minimum number of processed transactions from the N blockchain nodes as the first blockchain node.
In an alternative implementation, the processing unit 701 is further configured to: for any one of the N blockchain nodes, performing the following operations: determining heartbeat information of the block chain node in a preset period; and updating the running state of the blockchain node according to the heartbeat information.
In an alternative implementation, the processing unit 701 is further configured to: the number of processed transactions for the first blockchain node is increased.
In an alternative implementation, the processing unit 701 is further configured to: determining a newly added second block chain node in the block chain link points according to the node record information; and establishing connection with the second block chain node, and updating node information corresponding to the second block chain link point in the node record information.
In an alternative implementation manner, the processing unit 701 is specifically configured to: determining the running state of the second blockchain node according to the heartbeat information of the second blockchain node; the number of processed transactions for the second blockchain node is set to an initial value.
Based on the same inventive concept, an embodiment of the present application further provides a computing device, including:
A memory for storing program instructions;
and the processor is used for calling the program instructions stored in the memory and executing the transaction processing method according to the obtained program.
Based on the same inventive concept, the embodiments of the present application also provide a computer-readable nonvolatile storage medium including computer-readable instructions, which when read and executed by a computer, cause the computer to perform the transaction processing method described above.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. 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.
While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the spirit or scope of the application. Thus, it is intended that the present application also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (7)

1. A transaction processing method, comprising:
The proxy application service receives a transaction request of the blockchain application service; the agent application service is respectively connected with N block chain link points in the block chain network; n is a positive integer, node information corresponding to block chain link points does not need to be recorded in the block chain application service, and the block chain nodes connected by the proxy application service are dynamically changed;
The proxy application service obtains a node registration record; the node registration record comprises the running state of the blockchain node and the processed transaction number of the blockchain node; the agent application service determines a blockchain node which is in a normal running state and has the minimum number of processed transactions from the N blockchain nodes based on a load balancing algorithm, and takes the blockchain node as a first blockchain node;
for any one of the N blockchain nodes, performing the following operations:
The proxy application service determines heartbeat information of the blockchain node in a preset period;
the proxy application service updates the running state of the blockchain node according to the heartbeat information;
the proxy application service sends the transaction request to the blockchain network through the first blockchain link point.
2. The method of claim 1, wherein the proxy application service determines, as the first blockchain node, a blockchain node that is in a normal operation state and has a minimum number of processed transactions from the N blockchain nodes based on a load balancing algorithm, and further comprising:
the proxy application service increases the number of processed transactions for the first blockchain node.
3. The method of any one of claims 1 to 2, further comprising:
The agent application service determines a newly added second block chain node in the block chain link points according to node record information;
and the proxy application service establishes connection with the second block chain node and updates node information corresponding to the second block chain node in the node record information.
4. The method of claim 3, wherein updating the node information corresponding to the second blockchain node in the node record information comprises:
the proxy application service determines the running state of the second blockchain node according to the heartbeat information of the second blockchain node;
the proxy application service sets the number of processed transactions for the second blockchain node to an initial value.
5. A transaction processing device, comprising:
A processing unit and a receiving and transmitting unit;
the receiving and transmitting unit is used for receiving a transaction request of the blockchain application service; the receiving and transmitting units are respectively connected with N block chain link points in the block chain network; n is a positive integer, node information corresponding to block chain link points does not need to be recorded in the block chain application service, and the block chain nodes connected with the receiving and transmitting units are dynamically changed;
The processing unit is used for acquiring a node registration record; the node registration record comprises the running state of the blockchain node and the processed transaction number of the blockchain node; determining a blockchain node which is in a normal running state and has the minimum number of processed transactions from the N blockchain nodes based on a load balancing algorithm, wherein the blockchain node is used as a first blockchain node;
for any one of the N blockchain nodes, performing the following operations:
determining heartbeat information of the block chain node in a preset period;
updating the running state of the blockchain node according to the heartbeat information;
The transceiver unit is further configured to send the transaction request to the blockchain network through the first blockchain link point.
6. A computing device, comprising:
A memory for storing program instructions;
A processor for invoking program instructions stored in said memory to perform the method of any of claims 1 to 4 in accordance with the obtained program.
7. A computer readable non-transitory storage medium comprising computer readable instructions which, when read and executed by a computer, cause the computer to perform the method of any of claims 1 to 4.
CN202010551815.4A 2020-06-17 2020-06-17 Transaction processing method and device Active CN111652728B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010551815.4A CN111652728B (en) 2020-06-17 2020-06-17 Transaction processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010551815.4A CN111652728B (en) 2020-06-17 2020-06-17 Transaction processing method and device

Publications (2)

Publication Number Publication Date
CN111652728A CN111652728A (en) 2020-09-11
CN111652728B true CN111652728B (en) 2024-06-28

Family

ID=72350010

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010551815.4A Active CN111652728B (en) 2020-06-17 2020-06-17 Transaction processing method and device

Country Status (1)

Country Link
CN (1) CN111652728B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112288577B (en) * 2020-10-29 2023-09-12 中国工商银行股份有限公司 Transaction processing method, device, electronic equipment and medium for distributed service
CN112507387B (en) * 2021-02-04 2021-06-01 北京全息智信科技有限公司 Distributed data and model calculation method and device based on block chain
CN115511486A (en) * 2021-06-07 2022-12-23 腾讯科技(深圳)有限公司 Transaction processing method, device, medium and electronic equipment

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111080449A (en) * 2019-12-03 2020-04-28 深圳前海微众银行股份有限公司 Block chain cross-chain transaction method, management node and block chain network

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109117097B (en) * 2018-09-05 2020-06-12 深圳正品创想科技有限公司 Data storage method and system based on block chain
WO2020106845A1 (en) * 2018-11-23 2020-05-28 Amazon Technologies, Inc. Enabling access across private networks for a managed blockchain service
CN109559227A (en) * 2018-11-29 2019-04-02 咪咕文化科技有限公司 Cross-block chain network transaction method, device and storage medium
CN111027971B (en) * 2018-12-07 2023-08-22 深圳市智税链科技有限公司 Method, proxy node and medium for determining accounting node in blockchain network
CN110458582B (en) * 2019-01-29 2023-12-12 深圳市智税链科技有限公司 Business processing method, device, medium and electronic equipment based on block chain system
CN110149323B (en) * 2019-05-06 2020-07-10 山东公链信息科技有限公司 Processing device with ten-million-level TPS (platform secure protocol) contract processing capacity
CN110602108B (en) * 2019-09-16 2021-08-10 腾讯科技(深圳)有限公司 Data communication method, device, equipment and storage medium based on block chain network
CN111163129B (en) * 2019-12-05 2021-12-14 深圳前海微众银行股份有限公司 Resource processing method and device based on cross-link network

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111080449A (en) * 2019-12-03 2020-04-28 深圳前海微众银行股份有限公司 Block chain cross-chain transaction method, management node and block chain network

Also Published As

Publication number Publication date
CN111652728A (en) 2020-09-11

Similar Documents

Publication Publication Date Title
CN111652728B (en) Transaction processing method and device
CN111163130B (en) Network service system and data transmission method thereof
CN112671928B (en) Equipment centralized management architecture, load balancing method, electronic equipment and storage medium
CN107181780B (en) Communication channel processing method and system
CN110442610A (en) The method, apparatus of load balancing calculates equipment and medium
CN111064626B (en) Configuration updating method, device, server and readable storage medium
CN114189525B (en) Service request method and device and electronic equipment
CN111984289A (en) Service updating method, device, equipment and storage medium
US8832215B2 (en) Load-balancing in replication engine of directory server
CN111400041A (en) Server configuration file management method and device and computer readable storage medium
CN114124948A (en) High-availability method, device, equipment and readable medium for cloud component
CN114500546B (en) Communication message sending method, device and equipment based on load balancing cluster
EP4030776A1 (en) Method and apparatus for triggering vomci function from olt to send omci messages
CN111431730B (en) Service processing method, system, computer equipment and readable medium
CN113179295B (en) Message processing method and device
EP3672203A1 (en) Distribution method for distributed data computing, device, server and storage medium
CN112073499A (en) Dynamic service method of multi-machine type cloud physical server
US11595471B1 (en) Method and system for electing a master in a cloud based distributed system using a serverless framework
CN115225645A (en) Service updating method, device, system and storage medium
CN114598700A (en) Communication method and communication system
CN108848156B (en) Access gateway processing method, device and storage medium
CN107454021B (en) Communication method and device
CN111416852A (en) Method for session synchronization among multiple load balancers and load balancer
CN113391759A (en) Communication method and device
CN111464520B (en) Data processing method and device, storage medium 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