Transaction monitoring method and device based on blockchain

By introducing transaction monitoring methods in blockchain transactions, monitoring endorsement and block drop operations and sending events, the problem of low timeliness of complex transactions is solved, and real-time and efficiency of transactions are improved.

CN115865728BActive Publication Date: 2024-12-24INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211479703.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-24
Publication Date
2024-12-24
Estimated Expiration
2042-11-24

AI Technical Summary

Technical Problem

Complex business transactions have low timeliness in blockchain scenarios, mainly because the client needs to connect to blockchain nodes multiple times to call smart contracts, and the interaction between cross-chain and cross-systems leads to long transaction links and long time.

Method used

Provide a blockchain-based transaction monitoring method, which can obtain transaction information of the business initiator, endorse and block operations, and use pre-deployed listening components to monitor events, and directly send events to subscribers, Customize on-chain event listening rules to meet the needs of different business scenarios and reduce call links.

Benefits of technology

Real-time transactions are realized, and through custom listening rules and proactively triggering off-chain business operations, the call link is saved and the transaction efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115865728B_ABST
    Figure CN115865728B_ABST
Patent Text Reader

Abstract

The present invention provides a transaction monitoring method and device based on blockchain, which can be used in the financial field or other technical fields. The method includes: obtaining business transaction information of a business initiator; endorsing and / or blocking the business transaction information, and in the process of endorsing and / or blocking the business transaction information, using a pre-deployed monitoring component to monitor the endorsement operation and / or the blocking operation; sending the event monitored by the monitoring component to the subscriber of the event. The device is used to execute the above method. In the transaction monitoring method and device based on blockchain provided by an embodiment of the present invention, the business initiator can customize the on-chain event monitoring rules, add customized monitoring in the smart contract of the blockchain, and the blockchain node actively sends each event to the subscriber of the event, directly triggering other business operations under the chain, saving the call link and ensuring the real-time nature of the transaction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and in particular to a transaction monitoring method and device based on blockchain. Background Art

[0002] Currently, business systems complete business transactions by calling smart contracts. Many business transactions are relatively complex. Multiple contract calls and business operations of the business system itself need to be executed in one transaction. There is a sequence dependency between these operation steps, and even cross-chain operations are involved. In this case, the interaction between alliance applications on the same chain generally passes the transaction process through the business system of the application itself, and cross-chain interactions between different chains generally pass through the relay chain.

[0003] Since complex business transactions are generally account-related transactions, they require high timeliness. At present, the connection between the business system client and the blockchain node is time-consuming. For complex businesses, the client needs to connect to the blockchain node multiple times to call the smart contract. Moreover, for cross-chain and cross-system business transactions, the interaction between multiple systems and multiple chains leads to long transaction links and long time consumption, which is not conducive to the implementation of such transactions in blockchain scenarios. Summary of the invention

[0004] In view of the problems in the prior art, the embodiments of the present invention provide a transaction monitoring method and device based on blockchain, which can at least partially solve the problems existing in the prior art.

[0005] In one aspect, the present invention provides a transaction monitoring method based on blockchain, comprising:

[0006] Obtain business transaction information of the business initiator;

[0007] Performing an endorsement operation and / or a block operation on the business transaction information, and in the process of performing the endorsement operation and / or the block operation on the business transaction information, using a pre-deployed monitoring component to monitor the endorsement operation and / or the block operation;

[0008] Send the event monitored by the monitoring component to the subscriber of the event.

[0009] On the other hand, the present invention provides a transaction monitoring device based on blockchain, comprising:

[0010] An acquisition module is used to acquire business transaction information of the business initiator;

[0011] a processing module, configured to perform an endorsement operation and / or a block operation on the business transaction information, and in the process of performing the endorsement operation and / or the block operation on the business transaction information, monitor the endorsement operation and / or the block operation using a pre-deployed monitoring component;

[0012] The sending module is used to send the event monitored by the monitoring component to the subscriber of the event.

[0013] On the other hand, the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the blockchain-based transaction monitoring method described in any of the above embodiments are implemented.

[0014] On the other hand, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the blockchain-based transaction monitoring method described in any of the above embodiments.

[0015] The blockchain-based transaction monitoring method and device provided by the embodiment of the present invention obtains the business transaction information of the business initiator; performs endorsement operation and / or block operation on the business transaction information, and in the process of performing endorsement operation and / or block operation on the business transaction information, uses a pre-deployed monitoring component to monitor the endorsement operation and / or the block operation; and sends the event monitored by the monitoring component to the subscriber of the event. In this way, the business initiator can customize the on-chain event monitoring rules, add customized monitoring to the system smart contract and business smart contract of the blockchain, meet the monitoring needs of the business initiator in different business scenarios, and the blockchain node actively sends each event to the subscriber of the event, directly triggering other business operations under the chain, saving the call link and ensuring the real-time nature of the transaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0017] Figure 1 It is a flowchart of a transaction monitoring method based on blockchain provided by one embodiment of the present invention.

[0018] Figure 2 A system for real-time processing of transaction function operations across systems and chains provided by an embodiment of the present invention.

[0019] Figure 3 It is a flowchart of a transaction monitoring method based on blockchain provided by one embodiment of the present invention.

[0020] Figure 4It is a schematic diagram of a process for a function operation node to issue a monitoring digital identity certificate provided by an embodiment of the present invention.

[0021] Figure 5 It is a schematic diagram of a digital identity credential flow for verifying monitoring authority of a function operation node provided by an embodiment of the present invention.

[0022] Figure 6 It is a flow chart of injecting monitoring rules into a function operation node provided by an embodiment of the present invention.

[0023] Figure 7 It is a schematic diagram of the overall business process of a function operation system provided by an embodiment of the present invention.

[0024] Figure 8 It is a structural diagram of a transaction monitoring device based on blockchain proposed in one embodiment of the present invention.

[0025] Fig. 9 It is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical scheme and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention. It should be noted that, in the absence of conflict, the embodiments in this application and the features in the embodiments can be arranged arbitrarily with respect to each other.

[0027] The terms “first”, “second”, etc. used in this document do not particularly refer to an order or sequence, nor are they used to limit the present invention. They are only used to distinguish elements or operations described with the same technical terms.

[0028] The words “include,” “including,” “have,” “contain,” etc. used in this document are open-ended terms, meaning including but not limited to.

[0029] As used herein, "and / or" includes any and all permutations of the items described.

[0030] The present invention provides a blockchain-based transaction monitoring method, which can be applied to any node in a blockchain network.

[0031] Figure 1 A transaction monitoring method based on blockchain is provided in an embodiment of the present invention. Figure 1 As shown, a transaction monitoring method based on blockchain provided by an embodiment of the present invention includes:

[0032] S101, obtaining business transaction information of the business initiator;

[0033] In step S101, the business initiator refers to a transaction participant who initiates a business transaction. In some embodiments, the business transaction information is obtained from a function operation node to which the business initiator belongs. The function operation node is used to forward the business transaction information sent by the business initiator through the application server.

[0034] S102: Perform an endorsement operation and / or a block operation on the business transaction information, and in the process of performing the endorsement operation and / or the block operation on the business transaction information, use a pre-deployed monitoring component to monitor the endorsement operation and / or the block operation;

[0035] In step S102, when the node is a consensus node, the node is pre-deployed with a monitoring component for monitoring the endorsement operation on the business transaction information. When the node performs the endorsement operation on the business transaction information, the monitoring component monitors the endorsement operation. Similarly, when the node is an accounting node, the node is pre-deployed with a monitoring component for monitoring the block operation on the business transaction information. When the node performs the block operation on the business transaction information, the monitoring component monitors the block operation. When the node has both consensus and accounting functions, the node is pre-deployed with a monitoring component for monitoring the endorsement operation and the block operation.

[0036] S103: Send the event monitored by the monitoring component to the subscriber of the event.

[0037] In step S103, the events monitored by each monitoring component are written into the event queue in the business channel, and each event is returned to the subscriber of the event, so that each subscriber triggers the business operation after monitoring in sequence.

[0038] The embodiment of the present invention provides a transaction monitoring method based on blockchain, which obtains the business transaction information of the business initiator; performs endorsement operation and / or block operation on the business transaction information, and in the process of performing endorsement operation and / or block operation on the business transaction information, uses a pre-deployed monitoring component to monitor the endorsement operation and / or the block operation; and sends the event monitored by the monitoring component to the subscriber of the event. In this way, the business initiator can customize the on-chain event monitoring rules, add customized monitoring to the system smart contract and business smart contract of the blockchain, meet the monitoring needs of the business initiator in different business scenarios, and the blockchain node actively sends each event to the subscriber of the event, directly triggering other business operations under the chain, saving the call link and ensuring the real-time nature of the transaction.

[0039] In some embodiments, before endorsing and / or blocking the business transaction information, the method further includes: deploying a monitoring component according to the monitoring rules published by the business initiator. The monitoring content of the monitoring rules published by the business initiator is divided into two types: public and verified subscription. The public monitoring content can be subscribed to by all function operation nodes, and the verified subscription can only be subscribed to by function operation nodes that have passed digital identity verification. The monitoring content is customized by the alliance party of the transaction according to the business scenario; according to the monitoring content of the monitoring rules, the monitoring rules can be divided into multiple types, and different types of monitoring rules can deploy different monitoring components.

[0040] In some embodiments, deploying a monitoring component according to the monitoring rule issued by the service initiator includes:

[0041] If the monitoring rule issued by the service initiator is block monitoring, a block monitoring component is deployed on the local node, wherein the block monitoring component is used to monitor the block placement operation of the local node; and / or

[0042] If the monitoring rule issued by the service initiator is transaction monitoring, a transaction monitoring component is deployed on this node, wherein the transaction monitoring component is used to monitor the endorsement operation of this node; and / or

[0043] If the monitoring rule published by the business initiator is chain code monitoring, the chain code monitoring component is injected into the smart contract source code of this node, and the chain code monitoring component is used to monitor the execution status of the smart contract of this node.

[0044] Among them, block monitoring is that business applications initiate business transactions and block monitoring, call the consensus node on the chain for endorsement, and trigger the block monitoring after the accounting node falls into the block, and write it into the event queue in the business channel, and trigger the business operations after the block monitoring in sequence; transaction monitoring is similar to block monitoring, the difference is that it will initiate monitoring after the consensus node endorses, and write the monitoring into the event queue in the business channel, and trigger the business operations after the transaction monitoring in sequence; compared with the first two monitoring, chain code monitoring is more flexible and complex. The first two monitoring are generally public monitoring, while chain code monitoring requires permission control. The principle is to inject monitoring fragments into the system smart contract and business smart contract. The system smart contract is injected with the permission control of subscription monitoring, and the business smart contract is injected according to the business scenario. It is necessary to judge the execution status and then monitor in real time to trigger other business operations under the chain.

[0045] In some embodiments, if the monitoring rule issued by the service initiator is block monitoring, deploying the block monitoring component on the node includes: obtaining the block monitoring component generated by the function operation node to which the service initiator belongs according to the monitoring rule issued by the service initiator, and deploying the block monitoring component locally;

[0046] If the monitoring rule published by the service initiator is transaction monitoring, deploying the transaction monitoring component at the node includes: obtaining the transaction monitoring component generated by the function operation node to which the service initiator belongs according to the monitoring rule published by the service initiator, and deploying the transaction monitoring component locally;

[0047] If the monitoring rule published by the business initiator is chain code monitoring, injecting the chain code monitoring component into the smart contract source code of this node includes: according to the smart contract acquisition request sent by the function operation node to which the business initiator belongs, sending the local smart contract source code to the function operation node, wherein the function operation node is used to generate a chain code monitoring component according to the monitoring rule sent by the business initiator, and inserting the chain code monitoring component into the source code of the smart contract to generate an upgraded smart contract; obtaining the upgraded smart contract, and deploying the upgraded smart contract locally.

[0048] Among them, when the business application initiates business transactions and block monitoring, the function operation node will sign the business transaction and parse the content of the block monitoring, call the consensus node on the chain for endorsement, and trigger the block monitoring after the accounting node lands the block and writes it into the event queue in the business channel, which is returned to the function operation node. The function operation node will trigger the business operations after the block monitoring in sequence; transaction monitoring is similar to block monitoring, but the difference is that monitoring will be initiated after the consensus node endorses it, and the monitoring will be written into the event queue in the business channel, which is returned to the function operation node. The function operation node will trigger the business operations after the transaction monitoring in sequence; compared with the first two monitoring, chain code monitoring is to inject monitoring fragments into system smart contracts and business smart contracts through function operation nodes.

[0049] In some embodiments, sending the event monitored by the monitoring component to the subscriber of the event includes: querying the function operation node endorsed on the chain to which the subscriber of the event monitored by the monitoring component belongs; sending the event monitored by the monitoring component to the function operation node, wherein the function operation node is used to send the event monitored by the monitoring component to the subscriber.

[0050] Among them, the consensus node or accounting node that writes the monitoring event obtains the monitoring address and port of the function operation node that subscribes to the event from the chain, and pushes the monitoring event to the function operation node to which each subscriber belongs; the function operation node receives the subscribed event, uses the digital identity private key to decrypt the event message, and initiates a service call based on the event.

[0051] In some embodiments, the subscriber includes business participants who participate in business transactions and / or blockchain nodes in other isomorphic chain networks. If it is an interface call of a business system (business system of the initiator or other business system), the digital identity public key of the business system is obtained from the chain, and the public key is used to encrypt the message to initiate a service call; if it is a blockchain node service call of other isomorphic chains, the function operation node needs to request the identity certificate of the institution of the isomorphic chain, and use the certificate to initiate a transaction request on the chain. The consensus node of the isomorphic chain completes the transaction endorsement after verifying the identity, and the accounting node completes the block placement; after the monitoring event is completed, the function operation node of the initiator is notified, and the subsequent transaction steps can be continued.

[0052] For a better understanding of the present invention, a specific embodiment is provided below to illustrate the transaction monitoring method based on blockchain provided by the present invention.

[0053] The embodiment of the present invention combines digital identity and blockchain event monitoring technology to provide a system that can process transaction function operations in real time across systems and chains. The detailed technical solution is as follows:

[0054] like Figure 2 As shown, this system mainly includes four parts: application server 1, blockchain network (consensus node 2 and accounting node 3), and function operation node 4. Application server 1 is responsible for initiating business transactions, function operation node 4 integrates the functions of digital identity and blockchain client, and is responsible for issuing digital identity certificates, verifying digital identity certificates, chain operations, transmitting digital identity certificates, etc. The blockchain network (consensus node 2 and accounting node 3) is responsible for endorsing digital identity certificate hash, monitoring permissions, digital identity public key and other data, and completing the event monitoring function.

[0055] The application server 1 is a business system server of the alliance party, which is mainly responsible for initiating business transactions and publishing monitoring content. Business transactions are business process transactions. The monitoring content is divided into two types: public and verified subscription. The public monitoring content is acceptable to all function operation nodes 4. The monitoring that requires verification and subscription can only be accepted by the function operation node 4 that has verified the digital identity. The monitoring content is customized by the alliance party according to the business scenario. For example, for the withdrawal transaction of three types of accounts, the transaction initiator of the three types of accounts initiates the withdrawal transaction to the withdrawal party. After the withdrawal party accepts the request, it completes the message parsing and message reorganization, and then initiates the settlement of the People's Bank of China. After the settlement is completed, the withdrawal party needs to continue to complete the account entry processing, and then return the result to the transaction initiator of the three types of accounts. For the withdrawal transaction, the business server needs to first endorse the withdrawal transaction on the chain, save the world state of the transaction initiator after deducting the withdrawal amount on the chain, and then request to publish the monitoring content of the settlement of the People's Bank of China, endorse the transaction of the settlement of the People's Bank of China, and then request to publish the monitoring content of the withdrawal party's account entry.

[0056] The blockchain network (consensus node 2 and accounting node 3) mainly completes the endorsement of business processes, the preservation of business data, and event monitoring. The event monitoring process is as follows Figure 3 As shown in the figure, the routing rules and subscription permissions of event monitoring are customized by business applications according to scenarios. There are three types of monitoring, including block monitoring, transaction monitoring and chain code monitoring: block monitoring is initiated by business applications. After the business transaction signature and block monitoring content analysis, the function operation node calls the consensus node on the chain for endorsement. After the accounting node lands the block, the block monitoring is triggered and written into the event queue in the business channel, and returned to the function operation node. The function operation node triggers the business operations after the block monitoring in sequence; transaction monitoring is similar to block monitoring, but the difference is that it will initiate monitoring after the consensus node endorses, write the monitoring into the event queue in the business channel, return to the function operation node, and trigger the business operations after the transaction monitoring in sequence by the function operation node; compared with the first two monitoring, chain code monitoring is more flexible and complex. The first two monitoring are generally public monitoring, while chain code monitoring requires permission control. The principle is to inject monitoring fragments into the system smart contract and business smart contract through the function operation node. The system smart contract is injected with the permission control of subscription monitoring, and the business smart contract is injected according to the business scenario. It is necessary to judge the execution status and then monitor in real time to trigger other business operations under the chain.

[0057] The function operation node 4 integrates the functions of digital identity and blockchain client, and is mainly responsible for the injection of monitoring rules into system smart contracts and business smart contracts, issuing and verifying monitoring digital identity certificates, and calling services in monitoring content across systems and isomorphic chains (supporting HTTP / HTTPS / GRPC / RPC protocols). The flowchart of issuing and verifying monitoring digital identity certificates by function operation nodes is shown in the figure below. Figure 4 and Figure 5 As shown, the process of issuing a monitoring digital identity certificate is as follows:

[0058] Prerequisite: All participating business applications in the business scenario register their digital identity DID through their respective function operation nodes, and the function operation nodes they hold automatically register their node digital identity DID when they are initialized. The local server stores the private key and the public key is endorsed on the chain. Application A is the business initiator, and application B needs to subscribe to the monitoring published by application A.

[0059] S1-1: Application B applies to subscribe to the monitoring published by Application A;

[0060] S1-2: The function operation node of application B selects the function operation node of the organization to which application A belongs through the organization ownership relationship of all function operation nodes and consensus nodes obtained on the chain, and applies for connection;

[0061] S1-3: The function operation node of application A establishes a connection by verifying the digital identity DID of the function operation node of application B endorsed on the chain;

[0062] S1-4: The function operation node of application B applies for the subscription permission of application A to publish and listen;

[0063] S1-5: The function computing node of application A issues the permission certificate

[0064] S1-6: On-chain endorsement permission data and credential hash;

[0065] S1-7: The function computing node of application A transmits the certificate to the function computing node of application B;

[0066] S1-8: The function computing node of application B hosts and stores the private key and authorization certificate of application B.

[0067] The process of verifying the digital identity certificate for monitoring permissions is as follows:

[0068] S2-1: Application A publishes monitoring;

[0069] S2-2: The function operation node of application A verifies the digital identity DID of application A;

[0070] S2-3: Use the identity private key of the function operation node of application A to sign the monitored content;

[0071] S2-4: Verify the digital identity of the request on the chain;

[0072] S2-5: Execute the smart contract, trigger monitoring according to the monitoring rules, and write to the monitoring queue;

[0073] S2-6: Query the digital identity DID of the function operation node of the application with the monitoring permission endorsed on the chain and the receiving monitoring interface exposed by the node;

[0074] S2-7: Use the public key of the on-chain function operation node to encrypt the monitoring and push the encrypted monitoring to the function operation node;

[0075] S2-8: The function operation node of application B receives the monitoring and decrypts the monitoring content;

[0076] S2-9: Call the service of application B according to the monitored content;

[0077] S2-10: Application B verifies the identity of the function node of the request and executes the business transaction;

[0078] S2-11: The monitoring content is executed.

[0079] The flowchart of the function operation node injection monitoring rules is as follows Figure 6As shown, the detailed process is:

[0080] S3-1: Business application requests to publish monitoring rules;

[0081] S3-2: The function operation node determines the category of the monitoring rule (block monitoring, transaction monitoring and chain code monitoring);

[0082] S3-3: If it is block monitoring, deploy the block monitoring component on the accounting node of the institution to which the business application belongs, monitor the block landing regularly, and trigger the block monitoring content after the block landing is completed;

[0083] S3-4: If it is transaction monitoring, deploy the transaction monitoring component on the consensus node in the channel where the business application is located, monitor the endorsement of the consensus node regularly, and trigger the transaction monitoring content when the endorsement is completed;

[0084] S3-5: If it is chain code monitoring, obtain the smart contract source code deployed on the consensus node in the channel where the business application is located, inject monitoring into the source code according to the monitoring keywords, repackage the source code and upgrade the smart contract;

[0085] S3-6: The injection monitoring of the function operation node is completed and the service application is returned;

[0086] S3-7: The business application receives a notification that the monitoring rule publishing is complete.

[0087] The overall business process of the function operation system of the embodiment of the present invention is as follows: Figure 7 As shown, the detailed process is:

[0088] T1: The business initiator initiates business transactions and publishes monitoring rules;

[0089] T2: The belonging function operation node of the initiating transaction verifies the digital identity of the transaction party, and then determines the monitoring type according to the content of the monitoring rule. If it is a block or transaction monitoring, the monitoring component is deployed on the accounting node or consensus node. If it is a chain code monitoring, the smart contract on the chain is obtained, and the monitoring code is added near the keywords in the smart contract source code according to the monitoring rules, and the contract is repackaged and uploaded to upgrade the deployment;

[0090] T3: The function operation node returns the monitoring rule publishing completion to the business initiator;

[0091] T4: The function operation node parses the business transaction content, reassembles the message, signs the transaction message with its own digital identity private key, and calls the endorsement interface of the blockchain consensus node;

[0092] T5: The blockchain consensus node verifies the security of the transaction message based on the public key endorsed by the function operation node on the chain, executes the operation smart contract, and triggers chain code monitoring during the operation, writing the monitoring event into the monitoring queue;

[0093] T6: The blockchain consensus node endorsement is completed, which can trigger transaction monitoring and write the monitoring event into the monitoring queue;

[0094] T7: Return the endorsement completion message to the function operation node;

[0095] T8: The consensus node or accounting node that writes the monitoring event obtains the monitoring address and port of the subscribed function operation node from the chain, encrypts the monitoring event with the public key of the digital identity of the function operation node, and pushes it to each subscribed function operation node respectively;

[0096] T9: The function computing node receives the subscribed event, decrypts the event message using the digital identity private key, and initiates a service call based on the event;

[0097] T10: If it is an interface call of a business system (the business system of the initiator or other business system), obtain the digital identity public key of the business system from the chain, use the public key to encrypt the message, and initiate the service call;

[0098] T11: If the blockchain node service call is from another isomorphic chain, the function operation node needs to request the identity certificate of the institution in the isomorphic chain, use the certificate to initiate a transaction request on the chain, and the consensus node of the isomorphic chain completes the transaction endorsement after verifying the identity, and the accounting node completes the block placement;

[0099] T12: After the monitoring event is completed, the initiator's function operation node is notified and can continue to complete the subsequent transaction steps.

[0100] The embodiment of the present invention introduces a combination of blockchain event monitoring and digital identity technology, and implements on-chain custom monitoring rules to complete business operations off-chain in quasi-real time while ensuring the security of on-chain and off-chain identities. It has at least the following advantages:

[0101] 1. The business system can customize the on-chain event monitoring rules and add customized monitoring in the system smart contracts and business smart contracts of the blockchain through function operation nodes to meet the monitoring needs of the business system in different business scenarios;

[0102] 2. Through the digital identity issued by the function operation node, the identity security of different business application systems in the process of publishing and receiving monitoring is verified to ensure the security of the entire business transaction chain;

[0103] 3. Function operation nodes support service calls of multiple protocols, including HTTP, HTTPS, GRPC (blockchain smart contract call), RPC (microservice), etc., directly triggering service interface calls of various application business systems and isomorphic chain blockchain nodes, saving call links and ensuring the real-time performance of cross-system and cross-chain transactions.

[0104] Figure 8 is a schematic diagram of a transaction monitoring device based on blockchain proposed in one embodiment of the present invention, such as Figure 8 As shown, a transaction monitoring device based on blockchain proposed in an embodiment of the present invention includes:

[0105] An acquisition module 21 is used to acquire business transaction information of a business initiator;

[0106] The processing module 22 is used to perform an endorsement operation and / or a block operation on the business transaction information, and in the process of performing the endorsement operation and / or the block operation on the business transaction information, monitor the endorsement operation and / or the block operation using a pre-deployed monitoring component;

[0107] The sending module 23 is used to send the event monitored by the monitoring component to the subscriber of the event.

[0108] The embodiment of the present invention provides a transaction monitoring method based on blockchain, which obtains the business transaction information of the business initiator; performs endorsement operation and / or block operation on the business transaction information, and in the process of performing endorsement operation and / or block operation on the business transaction information, uses a pre-deployed monitoring component to monitor the endorsement operation and / or the block operation; and sends the event monitored by the monitoring component to the subscriber of the event. In this way, the business initiator can customize the on-chain event monitoring rules, add customized monitoring to the system smart contract and business smart contract of the blockchain, meet the monitoring needs of the business initiator in different business scenarios, and the blockchain node actively sends each event to the subscriber of the event, directly triggering other business operations under the chain, saving the call link and ensuring the real-time nature of the transaction.

[0109] Optionally, the business transaction information is obtained from a function operation node to which the business initiator belongs.

[0110] Optionally, the device further includes: a deployment module, configured to deploy monitoring components according to the monitoring rules issued by the service initiator.

[0111] Optionally, the deployment module is used to:

[0112] If the monitoring rule issued by the service initiator is block monitoring, a block monitoring component is deployed on the local node, wherein the block monitoring component is used to monitor the block placement operation of the local node; and / or

[0113] If the monitoring rule issued by the service initiator is transaction monitoring, a transaction monitoring component is deployed on this node, wherein the transaction monitoring component is used to monitor the endorsement operation of this node; and / or

[0114] If the monitoring rule published by the business initiator is chain code monitoring, the chain code monitoring component is injected into the smart contract source code of this node, and the chain code monitoring component is used to monitor the execution status of the smart contract of this node.

[0115] Optionally, the deployment module is specifically used to:

[0116] Obtaining a block monitoring component generated by a function operation node to which the service initiator belongs according to a monitoring rule issued by the service initiator, and deploying the block monitoring component locally;

[0117] Obtaining a transaction monitoring component generated by a function operation node to which the service initiator belongs according to a monitoring rule issued by the service initiator, and deploying the transaction monitoring component locally;

[0118] According to the smart contract acquisition request sent by the function operation node to which the business initiator belongs, the local smart contract source code is sent to the function operation node, wherein the function operation node is used to generate a chain code monitoring component according to the monitoring rule sent by the business initiator, and insert the chain code monitoring component into the source code of the smart contract to generate an upgraded smart contract; obtain the upgraded smart contract, and deploy the upgraded smart contract locally.

[0119] Optionally, the sending module is specifically used for:

[0120] Query the function operation node to which the subscriber of the event monitored by the monitoring component of the subscription endorsed on the chain belongs;

[0121] The event monitored by the monitoring component is sent to the function operation node, wherein the function operation node is used to send the event monitored by the monitoring component to the subscriber.

[0122] Optionally, the subscribers include business participants participating in business transactions and / or blockchain nodes in other isomorphic chain networks.

[0123] The embodiments of the apparatus provided in the embodiments of the present invention can be specifically used to execute the processing flow of the above-mentioned method embodiments, and its functions are not described in detail here, and reference can be made to the detailed description of the above-mentioned method embodiments.

[0124] It should be noted that the blockchain-based transaction monitoring method and device provided in the embodiments of the present invention can be used in the financial field, and can also be used in any technical field other than the financial field. The embodiments of the present invention do not limit the application field of the blockchain-based transaction monitoring method and device.

[0125] Fig. 9 A schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention is shown in FIG. Fig. 9As shown, the electronic device may include: a processor (processor) 301, a communication interface (Communications Interface) 302, a memory (memory) 303 and a communication bus 304, wherein the processor 301, the communication interface 302, and the memory 303 communicate with each other through the communication bus 304. The processor 301 can call the logic instructions in the memory 303 to execute the logic instructions in 303 described in any of the above embodiments. It can be implemented in the form of a software function unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.

[0126] This embodiment discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the methods provided by the above-mentioned method embodiments.

[0127] This embodiment provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program enables the computer to execute the methods provided by the above-mentioned method embodiments.

[0128] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0129] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0130] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0131] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0132] In the description of this specification, the description with reference to the terms "one embodiment", "a specific embodiment", "some embodiments", "for example", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0133] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A transaction monitoring method based on blockchain, characterized in that: The method comprises: Obtain business transaction information of the business initiator; Performing an endorsement operation and / or a block operation on the business transaction information, and in the process of performing the endorsement operation and / or the block operation on the business transaction information, using a pre-deployed monitoring component to monitor the endorsement operation and / or the block operation; Send the event monitored by the monitoring component to the subscriber of the event; Before endorsing and / or blocking the business transaction information, the method further includes: The monitoring components are deployed according to the monitoring rules issued by the service initiator; the types of the monitoring rules are divided according to the monitoring content, and different types of monitoring rules deploy different monitoring components.

2. The method according to claim 1, characterized in that The business transaction information is obtained from the function operation node to which the business initiator belongs.

3. The method according to claim 1, characterized in that The deploying of the monitoring component according to the monitoring rule issued by the service initiator includes: If the monitoring rule issued by the service initiator is block monitoring, a block monitoring component is deployed on the local node, wherein the block monitoring component is used to monitor the block placement operation of the local node; and / or If the monitoring rule issued by the service initiator is transaction monitoring, a transaction monitoring component is deployed on this node, wherein the transaction monitoring component is used to monitor the endorsement operation of this node; and / or If the monitoring rule published by the business initiator is chain code monitoring, the chain code monitoring component is injected into the smart contract source code of this node, and the chain code monitoring component is used to monitor the execution status of the smart contract of this node.

4. The method according to claim 3, characterized in that: If the monitoring rule issued by the service initiator is block monitoring, deploying the block monitoring component at this node includes: Obtaining a block monitoring component generated by a function operation node to which the service initiator belongs according to a monitoring rule issued by the service initiator, and deploying the block monitoring component locally; If the monitoring rule published by the service initiator is transaction monitoring, the transaction monitoring component deployed at this node includes: Obtaining a transaction monitoring component generated by a function operation node to which the service initiator belongs according to a monitoring rule issued by the service initiator, and deploying the transaction monitoring component locally; If the monitoring rule published by the business initiator is chain code monitoring, the chain code monitoring component injected into the smart contract source code of this node includes: According to the smart contract acquisition request sent by the function operation node to which the business initiator belongs, the local smart contract source code is sent to the function operation node, wherein the function operation node is used to generate a chain code monitoring component according to the monitoring rule sent by the business initiator, and insert the chain code monitoring component into the source code of the smart contract to generate an upgraded smart contract; Obtain the upgraded smart contract, and deploy the upgraded smart contract locally.

5. The method according to claim 3, characterized in that: The sending of the event monitored by the monitoring component to the subscriber of the event includes: Query the function operation node to which the subscriber of the event monitored by the monitoring component of the subscription endorsed on the chain belongs; The event monitored by the monitoring component is sent to the function operation node, wherein the function operation node is used to send the event monitored by the monitoring component to the subscriber.

6. The method according to claim 5, characterized in that The subscribers include business participants participating in business transactions and / or blockchain nodes in other homogeneous chain networks.

7. A transaction monitoring device based on blockchain, characterized in that: The device comprises: An acquisition module is used to acquire business transaction information of the business initiator; a processing module, configured to perform an endorsement operation and / or a block operation on the business transaction information, and in the process of performing the endorsement operation and / or the block operation on the business transaction information, monitor the endorsement operation and / or the block operation using a pre-deployed monitoring component; The sending module is used to send the event monitored by the monitoring component to the subscriber of the event; The deployment module is used to deploy monitoring components according to the monitoring rules issued by the business initiator before endorsing and / or blocking the business transaction information; the types of monitoring rules are divided according to the monitoring content, and different types of monitoring rules deploy different monitoring components.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.