WO2020087739A1 - Block chain-based transaction detecting method, apparatus, device, and storage medium - Google Patents

Block chain-based transaction detecting method, apparatus, device, and storage medium Download PDF

Info

Publication number
WO2020087739A1
WO2020087739A1 PCT/CN2018/124621 CN2018124621W WO2020087739A1 WO 2020087739 A1 WO2020087739 A1 WO 2020087739A1 CN 2018124621 W CN2018124621 W CN 2018124621W WO 2020087739 A1 WO2020087739 A1 WO 2020087739A1
Authority
WO
WIPO (PCT)
Prior art keywords
block
transaction
transaction information
monitoring event
monitoring
Prior art date
Application number
PCT/CN2018/124621
Other languages
French (fr)
Chinese (zh)
Inventor
程立瑞
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020087739A1 publication Critical patent/WO2020087739A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/30Network architectures or network communication protocols for network security for supporting lawful interception, monitoring or retaining of communications or communication related information
    • 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
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present application relates to the field of data processing technology, and in particular to a blockchain-based transaction monitoring method, device, equipment, and storage medium.
  • a transaction monitoring method based on blockchain including:
  • the transaction monitoring event corresponding to the transaction information is automatically cancelled.
  • a blockchain-based transaction monitoring device including:
  • the logout transaction monitoring event module is configured to automatically cancel the transaction monitoring event corresponding to the transaction information when the transaction information completes the transaction in the blockchain network.
  • the transaction monitoring event corresponding to the transaction information is automatically cancelled.
  • FIG. 1 is a flowchart of a blockchain-based transaction monitoring method in an embodiment of this application
  • step S4 is a flowchart of step S4 in an embodiment
  • FIG. 3 is a judgment process diagram of a blockchain-based transaction monitoring method in an embodiment of this application.
  • FIG. 1 is a flowchart of a blockchain-based transaction monitoring method in an embodiment of the present application. As shown in FIG. 1, a blockchain-based transaction monitoring method includes the following steps:
  • Step S1 register transaction monitoring event: obtain transaction information initiated by the client in the blockchain network, and automatically register a corresponding transaction monitoring event for each transaction information.
  • a blockchain is a chained data structure that combines data blocks in a sequential connection in chronological order, and is a tamper-proof and unforgeable distributed ledger guaranteed by cryptography.
  • Smart contracts are based on these credible, non-tamperable data and can automatically execute some pre-defined rules and terms. For example, user information, including medical information and risk occurrence information, is true and credible, and automated claims are processed according to standardized insurance products in smart contracts.
  • the client node presets an input interface, and the client node obtains the transaction information of each transaction by calling the input interface.
  • the client node includes a mobile client , A computer client or a third-party client, the transaction information includes the order number, the information of both parties to the transaction, the location of the transaction, etc.
  • Users upload transaction information through the client node, the blockchain network obtains the transaction information initiated by the client node, the blockchain network can obtain multiple different transaction information initiated by the client from different sources, and the blockchain network The information is automatically registered for a corresponding transaction monitoring event.
  • a preset EventHub event processing center is called to automatically register a transaction monitoring event for each transaction information.
  • the registration process when registering transaction monitoring events is through the Fabric network structure of the blockchain network.
  • the EventHub event processing center is preset at the bottom of the Fabric network structure, and the transaction monitoring events are automatically registered through the EventHub event processing center.
  • the Fabric network structure in this step is one of the important structures in the blockchain network.
  • the Fabric network structure provides four services for the blockchain network, namely: identity service, strategy service, blockchain service and smart contract service.
  • Identity service The Fabric network structure is a permission blockchain structure. Each node in the blockchain network needs to identify identity information. The nodes in the blockchain network need to determine the permission level to participate in the transaction in the Fabric network structure.
  • Strategy service Provide strategy configuration and management functions for the blockchain network, realize access control and authority management, realize node joining or leaving the network, identity registration, verification, privacy, confidentiality and consensus strategy.
  • Blockchain service Provide the most basic ability to build a distributed ledger, realize data transmission, consensus and other functions, and provide a management framework for subscribing and publishing events.
  • Smart contract service It is used to verify the distributed transaction program running on the node, to automatically execute specific business rules, and finally update the status of the account information. Users can call the application interface of the Fabric network structure to implement business applications to build a distributed ledger of the blockchain network.
  • the EventHub event processing center at the bottom of the Fabric network structure is used to monitor the event behavior.
  • INotify is a file system change notification mechanism provided by the Linux kernel.
  • INotify can monitor file system changes for applications, such as file creation, deletion, read and write, and so on.
  • INotify has two basic objects.
  • the inotify object corresponds to a queue.
  • the application can add multiple listeners to the inotify object.
  • the event information can be read from the inotify object through the read () function; watch The object is used to describe the monitoring of the change event of the file system.
  • the monitoring target is a path of the file system, which can be a file or a folder.
  • Epoll can use a wait to listen to the read / write status of multiple descriptors at once.
  • EventHub event processing center By using the EventHub event processing center to automatically register a transaction monitoring event, registration is simple and convenient.
  • the transaction monitoring event generated by the EventHub event processing center can monitor large amounts of information, and the monitoring efficiency is high. When a large amount of transaction information is initiated, it will not A blocking event occurred.
  • Step S2 Monitor transaction information: call the transaction monitoring event to monitor each transaction information. When the transaction information is abnormal, report the transaction information to the smart contract of the blockchain network to obtain the alarm rules in the smart contract. The processing type corresponding to the alarm rule is fed back to the client.
  • the step of invoking the transaction monitoring event to monitor each transaction information includes: invoking the transaction monitoring event, obtaining transaction information, invoking the exception rule in the smart contract, and matching the transaction information with the exception rule If the transaction information triggers an abnormal rule, it is determined that a transaction abnormality has occurred in the transaction information.
  • the smart contracts are preset with exception rules, alarm rules, and processing types.
  • the anomaly rules may include the transaction rules such as whether the transaction amount is excessive, whether the information of both parties of the transaction exists, and whether the transaction location is transacted in different places.
  • the transaction information does not comply with the transaction rules of a normal transaction, it is defined as an abnormal rule that triggers, and it is determined that the transaction is abnormal.
  • the transaction information is reported to the smart contract of the blockchain network.
  • the alarm rule also includes: Each alarm trigger condition corresponds to at least one processing type; when any one of the alarm trigger conditions is triggered by transaction information, the corresponding processing type is obtained and the processing type is fed back to the client.
  • this step sets multiple alarm triggering conditions and corresponding processing types for each transaction abnormality. For example, because the transaction amount exceeds a certain threshold, an alarm trigger condition is triggered, corresponding to the processing type. If another threshold is exceeded, another alarm trigger condition is triggered, corresponding to another processing type.
  • the blockchain network obtains the corresponding processing type from the smart contract according to the triggered alarm trigger condition, and sends it to the client node.
  • the client node handles transaction anomalies according to the type of processing feedback from the blockchain network.
  • This embodiment monitors the transaction process through transaction monitoring events, captures transaction abnormalities in a timely manner, and handles the abnormal conditions in a timely manner, which overcomes the delay processing problem of relocating the abnormal situation in the later period and finding the cause of the abnormality.
  • This implementation For example, it can ensure the normality of transactions and reduce abnormal risks.
  • the alarm rule further includes a processing execution script corresponding to the processing type; when any one of the alarm triggering conditions is triggered by the transaction information, the processing execution script is invoked to automatically perform the alarm processing, and the processing result is combined with the processing type Feedback to the client.
  • the blockchain network is preset with a processing execution script corresponding to the processing type, so that when an abnormal situation occurs in the transaction information, the processing execution script is executed according to the alarm triggering condition to achieve the purpose of automatically solving the abnormal situation, without the client Type of treatment, response to solution.
  • the processing execution script includes processing automatic sending of short messages and automatic sending of emails according to the contact information in the information of both parties of the transaction. This embodiment implements automatic processing of transaction exceptions, which improves the efficiency of transaction exception handling.
  • Step S3 cancel the transaction monitoring event: when the transaction information is completed in the blockchain network, the transaction monitoring event corresponding to the transaction information is automatically cancelled.
  • the transaction information completes the transaction in the blockchain network
  • the block corresponding to the transaction information has been broadcast, and all the nodes in the blockchain network have been verified, and the block corresponding to the transaction information has been uploaded.
  • the unregisterTxEvent event of EventHub automatically completes the cancellation.
  • the transaction abnormal information is also classified and stored according to a preset classification method, which is used as a reference solution for subsequent resolution of the transaction abnormality.
  • the preset classification method includes classification according to the alarm trigger condition of the transaction abnormal information the way.
  • a corresponding transaction monitoring event is automatically registered for each transaction information, as shown in FIG. 2, and further includes step S4:
  • Step S401 register block monitoring event: if the automatic registration of the corresponding transaction monitoring event fails for the transaction information, register a corresponding block monitoring event for the block generated by the transaction information in the blockchain network, and register the transaction information Save in the message queue.
  • step S1 in order to cope with the failure of the automatic registration transaction monitoring event in step S1, the real-time monitoring of transaction information cannot be realized.
  • the transaction information generates a block node to register the block monitoring event
  • the preset EventHub event processing center is called Automatically register a block monitoring event for each block, and save the corresponding transaction information in the message queue.
  • Step S402 monitoring block abnormality: calling block monitoring event to monitor the block, when block abnormality occurs in the block, the transaction information corresponding to the block is reported to the smart contract in the message queue to obtain the smart contract Alarm rules of the system, and feedback the processing type corresponding to the alarm rules to the client.
  • When monitoring the block it includes: calling the block monitoring event, obtaining the block, calculating the transaction information in the block through a hash algorithm to generate a verification hash value, and verifying the hash value and the current area in the block Compare the hash values of the blocks. If they are inconsistent, it is determined that the block is abnormal. If they match, the hash value of the previous block in the block, the hash value of the current block, and the blockchain list A comparison is made to determine whether the hash value of the previous block and the hash value of the current block are connected end to end. If not, it is determined that a block abnormality has occurred in the block.
  • abnormal verification is performed in two steps.
  • the first step is to perform a hash algorithm on the transaction information of the block again to obtain the verification hash value and the hash generated in the block header.
  • the values are compared, and if they do not match, it means that the transaction information in the block has been tampered with and it is determined that a block abnormality has occurred.
  • the second step of verification is performed, that is, the hash value of the previous block in the block header and the hash value of the current block are compared with the data stored in the blockchain list.
  • all nodes in the blockchain network and the network layer in the blockchain network maintain a blockchain list.
  • the blockchain list stores the hash values of all blocks that have been generated, and these hash values Connected end to end. If the two hash values of the monitored block are not contiguously connected, it is determined that a block abnormality has occurred.
  • Step S403 canceling the block monitoring event: when the block is completed in the blockchain network, the block monitoring event corresponding to the block is automatically cancelled.
  • the transaction information when the transaction information cannot be directly monitored, the transaction information is monitored by monitoring whether the block is abnormal, and when the block is abnormal, the transaction information in the message queue and the alarm rule in the smart contract Matching is performed, and the matching process is the same as step S2.
  • This embodiment is based on the transaction monitoring method of the blockchain. As shown in FIG. 3, by automatically registering a transaction monitoring event for each transaction information initiated by the client, real-time monitoring of the transaction information for abnormal conditions occurs. After that, the corresponding processing type can be fed back to the client through the alarm rules in time, which makes up for the gap of real-time processing abnormal monitoring in the block monitoring.
  • This embodiment also provides a solution to the failure to register a transaction monitoring event, that is, register a block monitoring event on the block, and monitor the transaction information again by monitoring the block.
  • a block exception occurs , The corresponding processing type is fed back to the client through the alarm rules, ensuring the normal progress of the transaction.
  • it before feeding back the processing type to the client, it also implements automatic processing of transaction exceptions by calling processing execution scripts for abnormal conditions, and improves the efficiency of transaction exception processing.
  • a blockchain-based transaction monitoring device As shown in FIG. 4, it includes the following modules:
  • Registered transaction monitoring event module set to obtain transaction information initiated by clients in the blockchain network, and automatically register a corresponding transaction monitoring event for each transaction information;
  • the monitoring module is set to call the transaction monitoring event to monitor each transaction information, and when the transaction information is abnormal, report the transaction information to the smart contract of the blockchain network to obtain The alarm rule in the smart contract, and feed back the processing type corresponding to the alarm rule to the client;
  • the logout transaction monitoring event module is configured to automatically cancel the transaction monitoring event corresponding to the transaction information when the transaction information completes the transaction in the blockchain network.
  • the monitoring module is also configured to call a transaction monitoring event, obtain transaction information, call an exception rule in a smart contract, and match the transaction information with the exception rule. If the transaction information triggers the exception rule, it is determined as the transaction information A transaction exception has occurred.
  • the registered transaction monitoring event module includes:
  • Register block monitoring event unit is set to register a corresponding block monitoring event for the block generated by the transaction information in the blockchain network if the transaction information corresponding to the transaction information registration fails automatically Keep in the message queue;
  • the block monitoring unit is set to call block monitoring events to monitor the block.
  • the transaction information corresponding to the block is reported to the smart contract in the message queue to obtain the alarm in the smart contract Rules, feedback the processing type corresponding to the alarm rules to the client;
  • the logout monitoring event unit is set to automatically cancel the block monitoring event corresponding to the block after the block is completed in the blockchain network.
  • the block monitoring unit is configured to call a block monitoring event to obtain a block, calculate the transaction information in the block through a hash algorithm to generate a verification hash value, and compare the verification hash value with the block
  • the hash value of the current block of the block is compared. If they are inconsistent, it is determined that the block is abnormal. If they match, the hash value of the previous block in the block, the hash value of the current block, and the area are compared.
  • the block chain list is compared to determine whether the hash value of the previous block and the hash value of the current block are connected end to end. If not, it is determined that a block abnormality has occurred in the block.
  • the alarm rules in the monitoring module include multiple alarm triggering conditions, and each alarm triggering condition corresponds to at least one processing type; the monitoring module is further configured to trigger any one of the alarm triggering conditions when the transaction information triggers, Obtain the corresponding processing type and feed back the processing type to the client.
  • the alarm rule in the monitoring module further includes a processing execution script corresponding to the processing type; the monitoring module is also configured to call the processing execution script when the transaction information triggers any one of the alarm triggering conditions, and automatically alarm Processing, and feed back the processing result and processing type to the client.
  • the registered transaction monitoring event module is set to call a preset EventHub event processing center to automatically register the transaction monitoring event; the unregistered transaction monitoring event module is set to call the unregisterTxEvent event in EventHub to cancel the transaction monitoring event.
  • a computer device which includes a memory and a processor.
  • the memory stores computer-readable instructions.
  • the processor implements the computer-readable instructions to implement the above The steps in the blockchain-based transaction monitoring method of the embodiment.
  • the program may be stored in a computer-readable storage medium, and the storage medium may include: Read only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Technology Law (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • General Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • Marketing (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Strategic Management (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Economics (AREA)
  • Development Economics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

A block chain-based transaction detecting method, an apparatus, a device, and a storage medium. Said method comprises: acquiring transaction information initiated by a client in a block chain network, and automatically registering a transaction detecting event for each piece of transaction information; calling the transaction detecting event, and detecting said each piece of transaction information, and when a transaction abnormality occurs in the transaction information, reporting the transaction information to an intelligent contract of the block chain network, acquiring an alert rule in the intelligent contract, and feeding a corresponding processing type back to the client; and when the transaction related to the transaction information is completed in the block chain network, automatically unregistering the transaction detecting event. The present invention registers a transaction detecting event for each piece of transaction information, to capture transaction abnormality conditions in a timely manner, and compensate for the blank, during block generation detection, in automatically processing abnormal conditions in real time, ensuring the normal operation of a transaction, and improving the abnormality processing efficiency during block generation of a block chain.

Description

基于区块链的交易监听方法、装置、设备和存储介质Transaction monitoring method, device, equipment and storage medium based on blockchain
本申请要求于2018年10月29日提交中国专利局、申请号为201811265445.7、发明名称为“基于区块链的交易监听方法、装置、设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requires the priority of the Chinese patent application submitted to the China Patent Office on October 29, 2018, with the application number 201811265445.7 and the invention titled "blockchain-based transaction monitoring method, device, equipment and storage medium", all of which are The content is incorporated into this application by reference.
技术领域Technical field
本申请涉及数据处理技术领域,尤其涉及一种基于区块链的交易监听方法、装置、设备和存储介质。The present application relates to the field of data processing technology, and in particular to a blockchain-based transaction monitoring method, device, equipment, and storage medium.
背景技术Background technique
区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机的新型应用模式,所谓共识机制是区块链系统中为不同节点之间建立信任、获取权益的数学算法。在区块链中进行交易,则形成区块,而现仅有趣链科技对区块、以及区块中的交易进行监控。Blockchain is a new application model of computers such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, etc. The so-called consensus mechanism is a mathematical algorithm for establishing trust and obtaining rights and interests between different nodes in the blockchain system. Blocks are formed when transactions are conducted on the blockchain, and now only interesting chain technology monitors the blocks and the transactions in the blocks.
趣链科技研究的一些监控方案主要是用于监控出块的总数、交易数、TPS、TPP的交易量,而对于区块中的出现的交易异常情况,却不能及时有效的进行监控和发出警告。后期在对交易异常情况进行处理时,需要对发生的异常情况进行定位和分析,找出异常原因才能进行处理,因交易异常无法及时得到处理,从而还会引发其他风险。Some of the monitoring schemes researched by FunChain Technology are mainly used to monitor the total number of blocks generated, the number of transactions, the transaction volume of TPS, TPP, but for the abnormal transaction in the block, it cannot be effectively and timely monitored and issued a warning . Later, when dealing with transaction anomalies, it is necessary to locate and analyze the anomalies that occur and find out the cause of the anomalies before they can be processed. As the anomalies in the transactions cannot be dealt with in a timely manner, other risks may also arise.
发明内容Summary of the invention
有鉴于此,有必要针对区块中的交易异常,不能及时有效的进行监控并提出告警的问题,提供一种基于区块链的交易监听方法、装置、设备和存储介质。In view of this, it is necessary to provide a method, device, equipment and storage medium for transaction monitoring based on the blockchain in response to the abnormal transaction in the block, which cannot be effectively and timely monitored and raised the alarm problem.
一种基于区块链的交易监听方法,包括:A transaction monitoring method based on blockchain, including:
获取区块链网络中的客户端发起的交易信息,对每笔所述交易信息自动注册一个对应的交易监听事件;Obtain the transaction information initiated by the client in the blockchain network, and automatically register a corresponding transaction monitoring event for each transaction information;
调用所述交易监听事件,对每笔所述交易信息进行监听,当所述交易信息发生交易异常时,将所述交易信息上报给所述区块链网络的智能合约,获取所述智能合约中的告警规则,将所述告警规则对应的处理类型反馈给所述客户端;Invoking the transaction monitoring event to monitor each transaction information, when the transaction information is abnormal, report the transaction information to the smart contract of the blockchain network to obtain the smart contract The alarm rule of the system, and feed back the processing type corresponding to the alarm rule to the client;
当所述交易信息在所述区块链网络中完成交易后,自动注销所述交易信息对应的所述交易监听事件。When the transaction information completes the transaction in the blockchain network, the transaction monitoring event corresponding to the transaction information is automatically cancelled.
一种基于区块链的交易监听装置,包括:A blockchain-based transaction monitoring device, including:
注册交易监听事件模块,设置为获取区块链网络中的客户端发起的交易信息,对每笔所述交易信息自动注册一个对应的交易监听事件;Registered transaction monitoring event module, set to obtain transaction information initiated by clients in the blockchain network, and automatically register a corresponding transaction monitoring event for each transaction information;
监听模块,设置为调用所述交易监听事件,对每笔所述交易信息进行监听,当所述交易信息发生交易异常时,将所述交易信息上报给所述区块链网络的智能合约,获取所述智能合约中的告警规则,将所述告警规则对应的处理类型反馈给所述客户端;The monitoring module is set to call the transaction monitoring event to monitor each transaction information, and when the transaction information is abnormal, report the transaction information to the smart contract of the blockchain network to obtain The alarm rule in the smart contract, and feed back the processing type corresponding to the alarm rule to the client;
注销交易监听事件模块,设置为当所述交易信息在所述区块链网络中完成交易后,自动注销所述交易信息对应的所述交易监听事件。The logout transaction monitoring event module is configured to automatically cancel the transaction monitoring event corresponding to the transaction information when the transaction information completes the transaction in the blockchain network.
一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行以下步骤:A computer device includes a memory and a processor. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor is caused to perform the following steps:
获取区块链网络中的客户端发起的交易信息,对每笔所述交易信息自动注册一个对应的交易监听事件;Obtain the transaction information initiated by the client in the blockchain network, and automatically register a corresponding transaction monitoring event for each transaction information;
调用所述交易监听事件,对每笔所述交易信息进行监听,当所述交易信息发生交易异常时,将所述交易信息上报给所述区块链网络的智能合约,获取所述智能合约中的告警规则,将所述告警规则对应的处理类型反馈给所述客户端;Invoking the transaction monitoring event to monitor each transaction information, when the transaction information is abnormal, report the transaction information to the smart contract of the blockchain network to obtain the smart contract The alarm rule of the system, and feed back the processing type corresponding to the alarm rule to the client;
当所述交易信息在所述区块链网络中完成交易后,自动注销所述交易信息 对应的所述交易监听事件。When the transaction information completes the transaction in the blockchain network, the transaction monitoring event corresponding to the transaction information is automatically cancelled.
一种存储有计算机可读指令的存储介质,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:A storage medium storing computer-readable instructions, which when executed by one or more processors, causes the one or more processors to perform the following steps:
获取区块链网络中的客户端发起的交易信息,对每笔所述交易信息自动注册一个对应的交易监听事件;Obtain the transaction information initiated by the client in the blockchain network, and automatically register a corresponding transaction monitoring event for each transaction information;
调用所述交易监听事件,对每笔所述交易信息进行监听,当所述交易信息发生交易异常时,将所述交易信息上报给所述区块链网络的智能合约,获取所述智能合约中的告警规则,将所述告警规则对应的处理类型反馈给所述客户端;Invoking the transaction monitoring event to monitor each transaction information, when the transaction information is abnormal, report the transaction information to the smart contract of the blockchain network to obtain the smart contract The alarm rule of the system, and feed back the processing type corresponding to the alarm rule to the client;
当所述交易信息在所述区块链网络中完成交易后,自动注销所述交易信息对应的所述交易监听事件。When the transaction information completes the transaction in the blockchain network, the transaction monitoring event corresponding to the transaction information is automatically cancelled.
上述基于区块链的交易监听方法、装置、设备和存储介质,包括获取区块链网络中的客户端发起的交易信息,对每笔所述交易信息自动注册一个对应的交易监听事件;调用所述交易监听事件,对每笔所述交易信息进行监听,当所述交易信息发生交易异常时,将所述交易信息上报给所述区块链网络的智能合约,获取所述智能合约中的告警规则,将所述告警规则对应的处理类型反馈给所述客户端;当所述交易信息在所述区块链网络中完成交易后,自动注销所述交易信息对应的所述交易监听事件。本申请通过对每笔交易信息都注册一个交易监听事件,来及时捕获交易异常情况,弥补了出块监控中实时自动处理异常情况的空白,保证了交易的正常进行,提高了区块链出块过程中对异常的处理效率。The above-mentioned blockchain-based transaction monitoring method, device, equipment and storage medium include acquiring transaction information initiated by clients in the blockchain network, automatically registering a corresponding transaction monitoring event for each transaction information; The transaction monitoring event, monitoring each of the transaction information, when the transaction information is abnormal, report the transaction information to the smart contract of the blockchain network to obtain the alarm in the smart contract Rules, feedback the processing type corresponding to the alarm rule to the client; when the transaction information completes the transaction in the blockchain network, the transaction monitoring event corresponding to the transaction information is automatically cancelled. This application registers a transaction monitoring event for each transaction information to capture transaction abnormalities in a timely manner. The efficiency of handling exceptions in the process.
附图说明BRIEF DESCRIPTION
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本申请的限制。By reading the detailed description of the preferred embodiments below, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments, and are not considered as limitations to the present application.
图1为本申请一个实施例中的基于区块链的交易监听方法的流程图;FIG. 1 is a flowchart of a blockchain-based transaction monitoring method in an embodiment of this application;
图2为一个实施例中步骤S4的流程图;2 is a flowchart of step S4 in an embodiment;
图3为本申请一个实施例中的基于区块链的交易监听方法的判断过程图;FIG. 3 is a judgment process diagram of a blockchain-based transaction monitoring method in an embodiment of this application;
图4为本申请一个实施例中基于区块链的交易监听装置的结构图。FIG. 4 is a structural diagram of a transaction monitoring device based on blockchain in an embodiment of the present application.
具体实施方式detailed description
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solutions and advantages of the present application more clear, the present application will be described in further detail in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
本技术领域技术人员可以理解,除非特意声明,这里使用的单数形式“一”、“一个”、“所述”和“该”也可包括复数形式。应该进一步理解的是,本申请的说明书中使用的措辞“包括”是指存在所述特征、整数、步骤、操作、元件和/或组件,但是并不排除存在或添加一个或多个其他特征、整数、步骤、操作、元件、组件和/或它们的组。Those skilled in the art can understand that unless specifically stated, the singular forms "a", "an", "said" and "the" used herein may also include the plural forms. It should be further understood that the word "comprising" used in the specification of the present application refers to the presence of the described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, Integers, steps, operations, elements, components, and / or their groups.
图1为本申请一个实施例中的基于区块链的交易监听方法的流程图,如图1所示,一种基于区块链的交易监听方法,包括以下步骤:FIG. 1 is a flowchart of a blockchain-based transaction monitoring method in an embodiment of the present application. As shown in FIG. 1, a blockchain-based transaction monitoring method includes the following steps:
步骤S1,注册交易监听事件:获取区块链网络中的客户端发起的交易信息,对每笔交易信息自动注册一个对应的交易监听事件。Step S1, register transaction monitoring event: obtain transaction information initiated by the client in the blockchain network, and automatically register a corresponding transaction monitoring event for each transaction information.
区块链网络是一种基于区块链技术的系统,也被称为分布式账本技术,是一种互联网数据库技术。其特点是去中心化、公开透明,让每个用户均可参与维护数据库记录。区块链网络是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链网络主要包括数据层、智能合约层等,其中,数据层封装了底层数据区块以及相关的数据加密和时间戳等基础数据和基本算法,而底层数据区块以链式结构呈现,即区块链是一种按照时间顺序将数据区块以顺序相连的方式组合成的一种链式数据结构,并以密码学方 式保证的不可篡改和不可伪造的分布式账本。智能合约是基于这些可信的不可篡改的数据,可以自动化的执行一些预先定义好的规则和条款。例如,用户信息,包括医疗信息、风险发生的信息,都是真实可信的,根据智能合约中标准化的保险产品,进行自动化的理赔。Blockchain network is a system based on blockchain technology, also known as distributed ledger technology, is an Internet database technology. It is characterized by decentralization, openness and transparency, allowing each user to participate in maintaining database records. Blockchain network is a new application model of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and so on. The blockchain network mainly includes a data layer, a smart contract layer, etc., where the data layer encapsulates the underlying data blocks and related data encryption and time stamps and other basic data and basic algorithms, while the underlying data blocks are presented in a chain structure. That is, a blockchain is a chained data structure that combines data blocks in a sequential connection in chronological order, and is a tamper-proof and unforgeable distributed ledger guaranteed by cryptography. Smart contracts are based on these credible, non-tamperable data and can automatically execute some pre-defined rules and terms. For example, user information, including medical information and risk occurrence information, is true and credible, and automated claims are processed according to standardized insurance products in smart contracts.
本步骤在区块链网络中的任一客户端节点发起交易信息时,客户端节点预设有输入界面,客户端节点通过调用输入界面获取每笔交易的交易信息,客户端节点包括手机客户端、电脑客户端或第三方客户端,交易信息包括订单编号、交易双方信息、交易地点等。用户通过客户端节点上传交易信息,区块链网络获取客户端节点发起的交易信息,区块链网络可获取不同来源的客户端发起的多笔不同的交易信息,区块链网络对每笔交易信息均自动注册一个对应的交易监听事件。In this step, when any client node in the blockchain network initiates transaction information, the client node presets an input interface, and the client node obtains the transaction information of each transaction by calling the input interface. The client node includes a mobile client , A computer client or a third-party client, the transaction information includes the order number, the information of both parties to the transaction, the location of the transaction, etc. Users upload transaction information through the client node, the blockchain network obtains the transaction information initiated by the client node, the blockchain network can obtain multiple different transaction information initiated by the client from different sources, and the blockchain network The information is automatically registered for a corresponding transaction monitoring event.
本步骤在对每笔交易信息自动注册一个对应的交易监听事件时,调用预设的EventHub事件处理中心为每一笔交易信息自动注册一个交易监听事件。在注册交易监听事件时的注册过程是通过区块链网络的Fabric网络结构,在Fabric网络结构底层预设有EventHub事件处理中心,通过EventHub事件处理中心自动注册交易监听事件。In this step, when a corresponding transaction monitoring event is automatically registered for each transaction information, a preset EventHub event processing center is called to automatically register a transaction monitoring event for each transaction information. The registration process when registering transaction monitoring events is through the Fabric network structure of the blockchain network. The EventHub event processing center is preset at the bottom of the Fabric network structure, and the transaction monitoring events are automatically registered through the EventHub event processing center.
本步骤中的Fabric网络结构是区块链网络中重要的结构之一。Fabric网络结构为区块链网络提供了四种服务,分别是:身份服务、策略服务、区块链服务及智能合约服务。身份服务:Fabric网络结构是权限区块链结构,参与区块链网络中的各个节点都需明确身份信息,区块链网络中的节点需要在Fabric网络结构中确定参加交易的权限级别。策略服务:为区块链网络提供策略配置及管理功能,实现访问控制和权限管理,实现节点加入或退出网络、身份的注册、验证、隐私、保密和共识策略等。区块链服务:提供构建分布式账本的最基础的能力,实现数据传输、共识达成等功能,提供订阅和发布事件的管理框架。智能合约服务:用于验证节点上运行的分布式交易程序,用以自动执行特定的业务规则,最终更新账本信息的状态。用户可以通过调用Fabric网络结构的应用接口,实现业务应用,来构建区块链网络的分布式账本。The Fabric network structure in this step is one of the important structures in the blockchain network. The Fabric network structure provides four services for the blockchain network, namely: identity service, strategy service, blockchain service and smart contract service. Identity service: The Fabric network structure is a permission blockchain structure. Each node in the blockchain network needs to identify identity information. The nodes in the blockchain network need to determine the permission level to participate in the transaction in the Fabric network structure. Strategy service: Provide strategy configuration and management functions for the blockchain network, realize access control and authority management, realize node joining or leaving the network, identity registration, verification, privacy, confidentiality and consensus strategy. Blockchain service: Provide the most basic ability to build a distributed ledger, realize data transmission, consensus and other functions, and provide a management framework for subscribing and publishing events. Smart contract service: It is used to verify the distributed transaction program running on the node, to automatically execute specific business rules, and finally update the status of the account information. Users can call the application interface of the Fabric network structure to implement business applications to build a distributed ledger of the blockchain network.
而Fabric网络结构底层的EventHub事件处理中心用于监听事件行为,在EventHub的构造函数中,它通过监控工具INotify与Epoll事件机制建立起对客户端增删事件及可读状态的监听。INotify是Linux内核所提供的一种文件系统变化通知机制,INotify可以为应用程序监控文件系统的变化,如文件的新建、删除、读写等等。INotify有两个基本对象,inotify对象对应一个队列,应用程序可以向inotify对象添加多个监听,当被监听的事件发生时,可以通过read()函数从inotify对象中将事件信息读取出来;watch对象则用来描述文件系统的变化事件的监听,它是一个二元组,包括监听目标和事件掩码两个元素,监听目标是文件系统的一个路径,可以是文件也可以是文件夹。Epoll可以使用一次等待监听多个描述符的可读/可写状态。The EventHub event processing center at the bottom of the Fabric network structure is used to monitor the event behavior. In the constructor of EventHub, it establishes monitoring of the client's add and delete events and readable status through the monitoring tool INotify and Epoll event mechanism. INotify is a file system change notification mechanism provided by the Linux kernel. INotify can monitor file system changes for applications, such as file creation, deletion, read and write, and so on. INotify has two basic objects. The inotify object corresponds to a queue. The application can add multiple listeners to the inotify object. When the monitored event occurs, the event information can be read from the inotify object through the read () function; watch The object is used to describe the monitoring of the change event of the file system. It is a two-tuple, including the monitoring target and the event mask. The monitoring target is a path of the file system, which can be a file or a folder. Epoll can use a wait to listen to the read / write status of multiple descriptors at once.
通过采用EventHub事件处理中心自动注册一个交易监听事件,注册简单方便,通过EventHub事件处理中心生成的交易监听事件,可以监听大批量信息时,监听效率高,当发起大批量交易信息时,也不会发生阻塞事件。By using the EventHub event processing center to automatically register a transaction monitoring event, registration is simple and convenient. The transaction monitoring event generated by the EventHub event processing center can monitor large amounts of information, and the monitoring efficiency is high. When a large amount of transaction information is initiated, it will not A blocking event occurred.
步骤S2,监听交易信息:调用交易监听事件,对每笔交易信息进行监听,当交易信息发生交易异常时,将交易信息上报给区块链网络的智能合约,获取智能合约中的告警规则,将告警规则对应的处理类型反馈给客户端。Step S2: Monitor transaction information: call the transaction monitoring event to monitor each transaction information. When the transaction information is abnormal, report the transaction information to the smart contract of the blockchain network to obtain the alarm rules in the smart contract. The processing type corresponding to the alarm rule is fed back to the client.
在一个实施例中,本步骤在调用交易监听事件,对每笔交易信息进行监听时,包括:调用交易监听事件,获取交易信息,调用智能合约中的异常规则,将交易信息与异常规则进行匹配,若交易信息触发异常规则,则判断为交易信息发生交易异常。In one embodiment, the step of invoking the transaction monitoring event to monitor each transaction information includes: invoking the transaction monitoring event, obtaining transaction information, invoking the exception rule in the smart contract, and matching the transaction information with the exception rule If the transaction information triggers an abnormal rule, it is determined that a transaction abnormality has occurred in the transaction information.
区块链网络中均设有智能合约,智能合约中预设有异常规则、告警规则、处理类型等。在对交易信息进行监听并确定是否发送交易异常时,将交易信息与异常规则进行匹配,异常规则可以包括交易金额是否超额、交易双方信息是否存在、交易地点是否异地交易等交易规则。当交易信息不符合一笔正常交易的交易规则时,定义为触发异常规则,判断为交易异常。There are smart contracts in the blockchain network, and the smart contracts are preset with exception rules, alarm rules, and processing types. When monitoring the transaction information and determining whether to send a transaction anomaly, match the transaction information with the anomaly rules. The anomaly rules may include the transaction rules such as whether the transaction amount is excessive, whether the information of both parties of the transaction exists, and whether the transaction location is transacted in different places. When the transaction information does not comply with the transaction rules of a normal transaction, it is defined as an abnormal rule that triggers, and it is determined that the transaction is abnormal.
当交易信息发生交易异常时,将交易信息上报给区块链网络的智能合约, 在获取智能合约中的告警规则,将告警规则对应的处理类型反馈给客户端时,还包括:告警规则包括多项告警触发条件,每项告警触发条件对应至少一项处理类型;当交易信息触发任一一项告警触发条件时,获取对应的处理类型,将处理类型反馈给客户端。When a transaction abnormality occurs in the transaction information, the transaction information is reported to the smart contract of the blockchain network. When obtaining the alarm rule in the smart contract and feeding back the processing type corresponding to the alarm rule to the client, the alarm rule also includes: Each alarm trigger condition corresponds to at least one processing type; when any one of the alarm trigger conditions is triggered by transaction information, the corresponding processing type is obtained and the processing type is fed back to the client.
由于交易信息的交易异常原因多种多样,本步骤对每种交易异常均设有多项告警触发条件及对应的处理类型。例如交易信息由于交易金额超过某一阈值,则触发一项告警触发条件,对应处理类型。若超过另一阈值,则触发另一项告警触发条件,对应另一处理类型。区块链网络根据触发的告警触发条件,从智能合约中获取对应处理类型后,发送给客户端节点。客户端节点根据区块链网络反馈的处理类型,对交易异常进行处理。Since there are various reasons for the transaction abnormality of the transaction information, this step sets multiple alarm triggering conditions and corresponding processing types for each transaction abnormality. For example, because the transaction amount exceeds a certain threshold, an alarm trigger condition is triggered, corresponding to the processing type. If another threshold is exceeded, another alarm trigger condition is triggered, corresponding to another processing type. The blockchain network obtains the corresponding processing type from the smart contract according to the triggered alarm trigger condition, and sends it to the client node. The client node handles transaction anomalies according to the type of processing feedback from the blockchain network.
本实施例通过交易监听事件,对交易流程进行监听,及时捕获交易异常情况,并对异常情况进行及时处理,克服了在后期从新定位异常情况,找出异常原因进行处理的延迟处理问题,本实施例能保证交易的正常,减少异常风险。This embodiment monitors the transaction process through transaction monitoring events, captures transaction abnormalities in a timely manner, and handles the abnormal conditions in a timely manner, which overcomes the delay processing problem of relocating the abnormal situation in the later period and finding the cause of the abnormality. This implementation For example, it can ensure the normality of transactions and reduce abnormal risks.
在一个实施例中,告警规则还包括与处理类型对应的处理执行脚本;当交易信息触发任一一项告警触发条件时,调用处理执行脚本,自动进行告警处理,并将处理结果和处理类型一起反馈给客户端。In one embodiment, the alarm rule further includes a processing execution script corresponding to the processing type; when any one of the alarm triggering conditions is triggered by the transaction information, the processing execution script is invoked to automatically perform the alarm processing, and the processing result is combined with the processing type Feedback to the client.
区块链网络中预设有对处理类型对应的处理执行脚本,以便于当交易信息发生异常情况时,根据告警触发条件,执行处理执行脚本,实现自动解决异常情况的目的,无需由客户端根据处理类型,应对解决方案。处理执行脚本包括根据交易双方信息中的联系方式,处理自动发送短信、自动发送邮件等手段。本实施例实现自动处理交易异常,提高了交易异常处理的效率。The blockchain network is preset with a processing execution script corresponding to the processing type, so that when an abnormal situation occurs in the transaction information, the processing execution script is executed according to the alarm triggering condition to achieve the purpose of automatically solving the abnormal situation, without the client Type of treatment, response to solution. The processing execution script includes processing automatic sending of short messages and automatic sending of emails according to the contact information in the information of both parties of the transaction. This embodiment implements automatic processing of transaction exceptions, which improves the efficiency of transaction exception handling.
步骤S3,注销交易监听事件:当交易信息在区块链网络中完成交易后,自动注销交易信息对应的交易监听事件。Step S3, cancel the transaction monitoring event: when the transaction information is completed in the blockchain network, the transaction monitoring event corresponding to the transaction information is automatically cancelled.
在自动注销交易信息对应的交易监听事件时,调用EventHub中的unregisterTxEvent事件来注销交易监听事件。When automatically canceling the transaction monitoring event corresponding to the transaction information, call the unregisterTxEvent event in EventHub to cancel the transaction monitoring event.
当交易信息在区块链网络中完成交易时,定义为交易信息对应的区块已经 广播,且被区块链网络中的节点均已验证,并且交易信息对应的区块完成上链。此时,无需对交易信息再进行监听,因此本步骤通过EventHub的unregisterTxEvent事件自动完成注销。When the transaction information completes the transaction in the blockchain network, it is defined that the block corresponding to the transaction information has been broadcast, and all the nodes in the blockchain network have been verified, and the block corresponding to the transaction information has been uploaded. At this time, there is no need to monitor the transaction information, so in this step, the unregisterTxEvent event of EventHub automatically completes the cancellation.
在对交易监听事件注销后,还对交易异常信息按照预设的分类方式进行分类存储,用作后续解决交易异常的参考方案,预设的分类方式包括按交易异常信息的告警触发条件进行分类的方式。After canceling the transaction monitoring event, the transaction abnormal information is also classified and stored according to a preset classification method, which is used as a reference solution for subsequent resolution of the transaction abnormality. The preset classification method includes classification according to the alarm trigger condition of the transaction abnormal information the way.
在一个实施例中,对每笔交易信息自动注册一个对应的交易监听事件,如图2所示,还包括步骤S4:In one embodiment, a corresponding transaction monitoring event is automatically registered for each transaction information, as shown in FIG. 2, and further includes step S4:
步骤S401,注册区块监听事件:若对交易信息自动注册对应的交易监听事件失败时,则对交易信息在区块链网络中产生的区块注册一个对应的区块监听事件,并将交易信息保存在消息队列中。Step S401, register block monitoring event: if the automatic registration of the corresponding transaction monitoring event fails for the transaction information, register a corresponding block monitoring event for the block generated by the transaction information in the blockchain network, and register the transaction information Save in the message queue.
本步骤为了应对步骤S1可能发生自动注册交易监听事件失败时,无法实现对交易信息的实时监听问题,在交易信息产生区块节点注册区块监听事件,注册时,调用预设的EventHub事件处理中心为每一个区块自动注册一个区块监听事件,并将对应的交易信息保存在消息队列中。In this step, in order to cope with the failure of the automatic registration transaction monitoring event in step S1, the real-time monitoring of transaction information cannot be realized. When the transaction information generates a block node to register the block monitoring event, during registration, the preset EventHub event processing center is called Automatically register a block monitoring event for each block, and save the corresponding transaction information in the message queue.
步骤S402,监听区块异常情况:调用区块监听事件,对区块进行监听,当区块发生区块异常时,在消息队列中将区块对应的交易信息上报给智能合约,获取智能合约中的告警规则,将告警规则对应的处理类型反馈给客户端。Step S402, monitoring block abnormality: calling block monitoring event to monitor the block, when block abnormality occurs in the block, the transaction information corresponding to the block is reported to the smart contract in the message queue to obtain the smart contract Alarm rules of the system, and feedback the processing type corresponding to the alarm rules to the client.
在对区块进行监听时,包括:调用区块监听事件,获取区块,将区块中的交易信息通过哈希算法计算生成验证哈希值,将验证哈希值与区块中的当前区块的哈希值进行比较,若不一致,则判断为区块发生区块异常;若一致,将区块中的前一区块的哈希值、当前区块的哈希值与区块链列表进行比对,判断前一区块的哈希值、当前区块的哈希值是否首尾相连,若不是,则判断为区块发生区块异常。When monitoring the block, it includes: calling the block monitoring event, obtaining the block, calculating the transaction information in the block through a hash algorithm to generate a verification hash value, and verifying the hash value and the current area in the block Compare the hash values of the blocks. If they are inconsistent, it is determined that the block is abnormal. If they match, the hash value of the previous block in the block, the hash value of the current block, and the blockchain list A comparison is made to determine whether the hash value of the previous block and the hash value of the current block are connected end to end. If not, it is determined that a block abnormality has occurred in the block.
本实施例在对区块进行监听时,通过两个步骤进行异常验证,第一步是通过对区块的交易信息再次进行哈希算法得到验证哈希值,与生成在区块头中的 哈希值进行比较,若不一致,则说明区块中的交易信息被篡改,判断为发生区块异常。若一致,则进行第二步验证,即将区块头中的前一区块的哈希值、当前区块的哈希值与区块链列表中保存的数据进行比较。通常区块链网络中的所有节点和区块链网络中的网络层均保存有一份区块链列表,区块链列表中保存所有已出块的区块的哈希值,且这些哈希值彼此首尾相连。若监听的区块两个哈希值不是收尾相连的,则判断为发生区块异常。In this embodiment, when monitoring a block, abnormal verification is performed in two steps. The first step is to perform a hash algorithm on the transaction information of the block again to obtain the verification hash value and the hash generated in the block header. The values are compared, and if they do not match, it means that the transaction information in the block has been tampered with and it is determined that a block abnormality has occurred. If they match, the second step of verification is performed, that is, the hash value of the previous block in the block header and the hash value of the current block are compared with the data stored in the blockchain list. Generally, all nodes in the blockchain network and the network layer in the blockchain network maintain a blockchain list. The blockchain list stores the hash values of all blocks that have been generated, and these hash values Connected end to end. If the two hash values of the monitored block are not contiguously connected, it is determined that a block abnormality has occurred.
步骤S403,注销区块监听事件:当区块在区块链网络中完成上链后,自动注销区块对应的区块监听事件。Step S403, canceling the block monitoring event: when the block is completed in the blockchain network, the block monitoring event corresponding to the block is automatically cancelled.
当被监听的区块已经广播,且被区块链网络中的节点均已验证,并且完成上链后,无需对区块再进行监听,因此本步骤通过EventHub的unregisterTxEvent事件自动完成区块监听事件的注销。When the monitored block has been broadcast, and the nodes in the blockchain network have been verified, and after the completion of the chain, there is no need to monitor the block, so this step automatically completes the block monitoring event through the unregisterTxEvent event of EventHub Logout.
本实施例在无法直接监听交易信息的情况下,通过监听区块是否异常的方式,对交易信息进行进行监控,当发生区块异常时,将消息队列中的交易信息与智能合约中的告警规则进行匹配,匹配过程与步骤步骤S2相同。In this embodiment, when the transaction information cannot be directly monitored, the transaction information is monitored by monitoring whether the block is abnormal, and when the block is abnormal, the transaction information in the message queue and the alarm rule in the smart contract Matching is performed, and the matching process is the same as step S2.
本实施例基于区块链的交易监听方法,如图3所示,通过对客户端发起的每笔交易信息均自动注册一个交易监听事件,来实时监听交易信息是否发生异常情况,在发生异常情况后,能及时通过告警规则将对应的处理类型反馈给客户端,弥补了出块监控中实时处理异常监控的空白。本实施例还对注册交易监听事件失败时,给出了应对方案,即对区块注册一个区块监听事件,通过监听区块的方式,再次对交易信息进行进行监控,当发生区块异常时,通过告警规则将对应的处理类型反馈给客户端,保证了交易的正常进行。本实施例在对处理类型反馈给客户端前,还对异常情况,通过调用处理执行脚本,实现了自动处理交易异常,提高了交易异常处理的效率。This embodiment is based on the transaction monitoring method of the blockchain. As shown in FIG. 3, by automatically registering a transaction monitoring event for each transaction information initiated by the client, real-time monitoring of the transaction information for abnormal conditions occurs. After that, the corresponding processing type can be fed back to the client through the alarm rules in time, which makes up for the gap of real-time processing abnormal monitoring in the block monitoring. This embodiment also provides a solution to the failure to register a transaction monitoring event, that is, register a block monitoring event on the block, and monitor the transaction information again by monitoring the block. When a block exception occurs , The corresponding processing type is fed back to the client through the alarm rules, ensuring the normal progress of the transaction. In this embodiment, before feeding back the processing type to the client, it also implements automatic processing of transaction exceptions by calling processing execution scripts for abnormal conditions, and improves the efficiency of transaction exception processing.
在一个实施例中,提出了一种基于区块链的交易监听装置,如图4所示,包括如下模块:In one embodiment, a blockchain-based transaction monitoring device is proposed. As shown in FIG. 4, it includes the following modules:
注册交易监听事件模块,设置为获取区块链网络中的客户端发起的交易信 息,对每笔所述交易信息自动注册一个对应的交易监听事件;Registered transaction monitoring event module, set to obtain transaction information initiated by clients in the blockchain network, and automatically register a corresponding transaction monitoring event for each transaction information;
监听模块,设置为调用所述交易监听事件,对每笔所述交易信息进行监听,当所述交易信息发生交易异常时,将所述交易信息上报给所述区块链网络的智能合约,获取所述智能合约中的告警规则,将所述告警规则对应的处理类型反馈给所述客户端;The monitoring module is set to call the transaction monitoring event to monitor each transaction information, and when the transaction information is abnormal, report the transaction information to the smart contract of the blockchain network to obtain The alarm rule in the smart contract, and feed back the processing type corresponding to the alarm rule to the client;
注销交易监听事件模块,设置为当所述交易信息在所述区块链网络中完成交易后,自动注销所述交易信息对应的所述交易监听事件。The logout transaction monitoring event module is configured to automatically cancel the transaction monitoring event corresponding to the transaction information when the transaction information completes the transaction in the blockchain network.
在一个实施例中,监听模块,还设置为调用交易监听事件,获取交易信息,调用智能合约中的异常规则,将交易信息与异常规则进行匹配,若交易信息触发异常规则,则判断为交易信息发生交易异常。In one embodiment, the monitoring module is also configured to call a transaction monitoring event, obtain transaction information, call an exception rule in a smart contract, and match the transaction information with the exception rule. If the transaction information triggers the exception rule, it is determined as the transaction information A transaction exception has occurred.
在一个实施例中,注册交易监听事件模块,包括:In one embodiment, the registered transaction monitoring event module includes:
注册区块监听事件单元,设置为若对交易信息自动注册对应的交易监听事件失败时,则对交易信息在区块链网络中产生的区块注册一个对应的区块监听事件,并将交易信息保存在消息队列中;Register block monitoring event unit is set to register a corresponding block monitoring event for the block generated by the transaction information in the blockchain network if the transaction information corresponding to the transaction information registration fails automatically Keep in the message queue;
区块监听单元,设置为调用区块监听事件,对区块进行监听,当区块发生区块异常时,在消息队列中将区块对应的交易信息上报给智能合约,获取智能合约中的告警规则,将告警规则对应的处理类型反馈给客户端;The block monitoring unit is set to call block monitoring events to monitor the block. When a block exception occurs in the block, the transaction information corresponding to the block is reported to the smart contract in the message queue to obtain the alarm in the smart contract Rules, feedback the processing type corresponding to the alarm rules to the client;
注销监听事件单元,设置为当区块在区块链网络中完成上链后,自动注销区块对应的区块监听事件。The logout monitoring event unit is set to automatically cancel the block monitoring event corresponding to the block after the block is completed in the blockchain network.
在一个实施例中,区块监听单元,设置为调用区块监听事件,获取区块,将区块中的交易信息通过哈希算法计算生成验证哈希值,将验证哈希值与区块中的当前区块的哈希值进行比较,若不一致,则判断为区块发生区块异常;若一致,将区块中的前一区块的哈希值、当前区块的哈希值与区块链列表进行比对,判断前一区块的哈希值、当前区块的哈希值是否首尾相连,若不是,则判断为区块发生区块异常。In one embodiment, the block monitoring unit is configured to call a block monitoring event to obtain a block, calculate the transaction information in the block through a hash algorithm to generate a verification hash value, and compare the verification hash value with the block The hash value of the current block of the block is compared. If they are inconsistent, it is determined that the block is abnormal. If they match, the hash value of the previous block in the block, the hash value of the current block, and the area are compared. The block chain list is compared to determine whether the hash value of the previous block and the hash value of the current block are connected end to end. If not, it is determined that a block abnormality has occurred in the block.
在一个实施例中,监听模块中的告警规则包括多项告警触发条件,每项告警触发条件对应至少一项处理类型;监听模块,还设置为当交易信息触发任一一项告警触发条件时,获取对应的处理类型,将处理类型反馈给客户端。In one embodiment, the alarm rules in the monitoring module include multiple alarm triggering conditions, and each alarm triggering condition corresponds to at least one processing type; the monitoring module is further configured to trigger any one of the alarm triggering conditions when the transaction information triggers, Obtain the corresponding processing type and feed back the processing type to the client.
在一个实施例中,监听模块中的告警规则还包括与处理类型对应的处理执行脚本;监听模块,还设置为当交易信息触发任一一项告警触发条件时,调用处理执行脚本,自动进行告警处理,并将处理结果和处理类型一起反馈给客户端。In one embodiment, the alarm rule in the monitoring module further includes a processing execution script corresponding to the processing type; the monitoring module is also configured to call the processing execution script when the transaction information triggers any one of the alarm triggering conditions, and automatically alarm Processing, and feed back the processing result and processing type to the client.
在一个实施例中,注册交易监听事件模块,设置为调用预设的EventHub事件处理中心进行自动注册交易监听事件;注销交易监听事件模块,设置为调用EventHub中的unregisterTxEvent事件来注销交易监听事件。In one embodiment, the registered transaction monitoring event module is set to call a preset EventHub event processing center to automatically register the transaction monitoring event; the unregistered transaction monitoring event module is set to call the unregisterTxEvent event in EventHub to cancel the transaction monitoring event.
在一个实施例中,提出了一种计算机设备,包括存储器和处理器,存储器中存储有计算机可读指令,计算机可读指令被处理器执行时,使得处理器执行计算机可读指令时实现上述各实施例的基于区块链的交易监听方法中的步骤。In one embodiment, a computer device is proposed, which includes a memory and a processor. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor implements the computer-readable instructions to implement the above The steps in the blockchain-based transaction monitoring method of the embodiment.
在一个实施例中,提出了一种存储有计算机可读指令的存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行上述各实施例的基于区块链的交易监听方法中的步骤。其中,存储介质可以为非易失性存储介质。In one embodiment, a storage medium storing computer-readable instructions is provided. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the block-based Steps in the chain's transaction monitoring method. The storage medium may be a non-volatile storage medium.
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁盘或光盘等。A person of ordinary skill in the art may understand that all or part of the steps in the various methods of the foregoing embodiments may be completed by instructing relevant hardware through a program. The program may be stored in a computer-readable storage medium, and the storage medium may include: Read only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, etc.
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above-mentioned embodiments can be combined arbitrarily. To simplify the description, all possible combinations of the technical features in the above-mentioned embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, All should be considered within the scope of this description.
以上所述实施例仅表达了本申请一些示例性实施例,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only express some exemplary embodiments of the present application, and their descriptions are more specific and detailed, but they should not be construed as limiting the patent scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which all fall within the protection scope of the present application. Therefore, the protection scope of the patent of this application shall be subject to the appended claims.

Claims (20)

  1. 一种基于区块链的交易监听方法,包括:A transaction monitoring method based on blockchain, including:
    获取区块链网络中的客户端发起的交易信息,对每笔所述交易信息自动注册一个对应的交易监听事件;Obtain the transaction information initiated by the client in the blockchain network, and automatically register a corresponding transaction monitoring event for each transaction information;
    调用所述交易监听事件,对每笔所述交易信息进行监听,当所述交易信息发生交易异常时,将所述交易信息上报给所述区块链网络的智能合约,获取所述智能合约中的告警规则,将所述告警规则对应的处理类型反馈给所述客户端;Invoking the transaction monitoring event to monitor each transaction information, when the transaction information is abnormal, report the transaction information to the smart contract of the blockchain network to obtain the smart contract The alarm rule of the system, and feed back the processing type corresponding to the alarm rule to the client;
    当所述交易信息在所述区块链网络中完成交易后,自动注销所述交易信息对应的所述交易监听事件。When the transaction information completes the transaction in the blockchain network, the transaction monitoring event corresponding to the transaction information is automatically cancelled.
  2. 根据权利要求1所述的基于区块链的交易监听方法,其中,所述调用所述交易监听事件,对每笔所述交易信息进行监听,包括:The blockchain-based transaction monitoring method according to claim 1, wherein the calling the transaction monitoring event to monitor each transaction information includes:
    调用所述交易监听事件,获取所述交易信息,调用所述智能合约中的异常规则,将所述交易信息与所述异常规则进行匹配,若所述交易信息触发所述异常规则,则判断为所述交易信息发生交易异常。Call the transaction monitoring event to obtain the transaction information, call the abnormal rule in the smart contract, match the transaction information with the abnormal rule, and if the transaction information triggers the abnormal rule, it is determined as A transaction abnormality occurred in the transaction information.
  3. 根据权利要求1所述的基于区块链的交易监听方法,其中,对每笔所述交易信息自动注册一个对应的交易监听事件,包括:The transaction monitoring method based on blockchain according to claim 1, wherein automatically registering a corresponding transaction monitoring event for each transaction information includes:
    若对所述交易信息自动注册对应的所述交易监听事件失败时,则对所述交易信息在所述区块链网络中产生的区块注册一个对应的区块监听事件,并将所述交易信息保存在消息队列中;If the automatic registration of the transaction monitoring event corresponding to the transaction information fails, register a corresponding block monitoring event for the block generated by the transaction information in the blockchain network, and transfer the transaction The information is saved in the message queue;
    调用所述区块监听事件,对所述区块进行监听,当所述区块发生区块异常时,在所述消息队列中将所述区块对应的所述交易信息上报给所述智能合约,获取所述智能合约中的告警规则,将所述告警规则对应的处理类型反馈给所述客户端;Call the block monitoring event to monitor the block, and when a block exception occurs in the block, report the transaction information corresponding to the block to the smart contract in the message queue , Obtaining the alarm rule in the smart contract, and feeding back the processing type corresponding to the alarm rule to the client;
    当所述区块在所述区块链网络中完成上链后,自动注销所述区块对应的所述区块监听事件。When the block is completely uploaded on the blockchain network, the block monitoring event corresponding to the block is automatically cancelled.
  4. 根据权利要求3所述的基于区块链的交易监听方法,其中,所述调用所述区块监听事件,对所述区块进行监听,包括:The blockchain-based transaction monitoring method according to claim 3, wherein the calling the block monitoring event to monitor the block includes:
    调用所述区块监听事件,获取所述区块,将所述区块中的交易信息通过哈希算法计算生成验证哈希值,将所述验证哈希值与所述区块中的当前区块的哈希值进行比较,若不一致,则判断为所述区块发生区块异常;Call the block monitoring event to obtain the block, calculate the transaction information in the block by a hash algorithm to generate a verification hash value, and compare the verification hash value with the current area in the block The hash values of the blocks are compared, and if they are inconsistent, it is determined that a block abnormality has occurred in the block;
    若一致,将所述区块中的前一区块的哈希值、当前区块的哈希值与区块链列表进行比对,判断前一区块的哈希值、当前区块的哈希值是否首尾相连,若不是,则判断为所述区块发生区块异常。If they match, the hash value of the previous block in the block and the hash value of the current block are compared with the blockchain list to determine the hash value of the previous block and the hash of the current block Whether the hope value is connected end to end, if not, it is determined that a block abnormality has occurred in the block.
  5. 根据权利要求1所述的基于区块链的交易监听方法,其中,所述获取所述智能合约中的告警规则,将所述告警规则对应的处理类型反馈给所述客户端,包括:The blockchain-based transaction monitoring method according to claim 1, wherein the acquiring an alarm rule in the smart contract and feeding back the processing type corresponding to the alarm rule to the client includes:
    所述告警规则包括多项告警触发条件,每项所述告警触发条件对应至少一项所述处理类型;The alarm rule includes multiple alarm trigger conditions, and each of the alarm trigger conditions corresponds to at least one of the processing types;
    当所述交易信息触发任一一项所述告警触发条件时,获取对应的处理类型,将所述处理类型反馈给所述客户端。When the transaction information triggers any one of the alarm triggering conditions, the corresponding processing type is obtained, and the processing type is fed back to the client.
  6. 根据权利要求5所述的基于区块链的交易监听方法,其中,所述告警规则还包括与所述处理类型对应的处理执行脚本;The blockchain-based transaction monitoring method according to claim 5, wherein the alarm rule further includes a processing execution script corresponding to the processing type;
    当所述交易信息触发任一一项所述告警触发条件时,调用所述处理执行脚本,自动进行告警处理,并将处理结果和所述处理类型一起反馈给所述客户端。When the transaction information triggers any one of the alarm triggering conditions, the processing execution script is invoked to automatically perform alarm processing, and feed back the processing result and the processing type to the client terminal.
  7. 根据权利要求1所述的基于区块链的交易监听方法,其中,所述对每笔所述交易信息自动注册一个对应的交易监听事件时,调用预设的EventHub事件处理中心进行自动注册所述交易监听事件;The blockchain-based transaction monitoring method according to claim 1, wherein when automatically registering a corresponding transaction monitoring event for each transaction information, a preset EventHub event processing center is called to automatically register the Transaction monitoring events;
    所述自动注销所述交易信息对应的交易监听事件时,调用所述EventHub中的unregisterTxEvent事件来注销所述交易监听事件。When the transaction monitoring event corresponding to the transaction information is automatically cancelled, the unregisterTxEvent event in the EventHub is called to cancel the transaction monitoring event.
  8. 一种基于区块链的交易监听装置,包括:A blockchain-based transaction monitoring device, including:
    注册交易监听事件模块,设置为获取区块链网络中的客户端发起的交易信息,对每笔所述交易信息自动注册一个对应的交易监听事件;Registered transaction monitoring event module, set to obtain transaction information initiated by clients in the blockchain network, and automatically register a corresponding transaction monitoring event for each transaction information;
    监听模块,设置为调用所述交易监听事件,对每笔所述交易信息进行监听,当所述交易信息发生交易异常时,将所述交易信息上报给所述区块链网络的智能合约,获取所述智能合约中的告警规则,将所述告警规则对应的处理类型反馈给所述客户端;The monitoring module is set to call the transaction monitoring event to monitor each transaction information, and when the transaction information is abnormal, report the transaction information to the smart contract of the blockchain network to obtain The alarm rule in the smart contract, and feed back the processing type corresponding to the alarm rule to the client;
    注销交易监听事件模块,设置为当所述交易信息在所述区块链网络中完成交易后,自动注销所述交易信息对应的所述交易监听事件。The logout transaction monitoring event module is configured to automatically cancel the transaction monitoring event corresponding to the transaction information when the transaction information completes the transaction in the blockchain network.
  9. 根据权利要求8所述的基于区块链的交易监听装置,其中,所述监听模块,还设置为调用所述交易监听事件,获取所述交易信息,调用所述智能合约中的异常规则,将所述交易信息与所述异常规则进行匹配,若所述交易信息触发所述异常规则,则判断为所述交易信息发生交易异常。The transaction monitoring device based on blockchain according to claim 8, wherein the monitoring module is further configured to call the transaction monitoring event, obtain the transaction information, call the abnormal rules in the smart contract, The transaction information matches the abnormal rule. If the transaction information triggers the abnormal rule, it is determined that a transaction abnormality has occurred in the transaction information.
  10. 根据权利要求8所述的基于区块链的交易监听装置,其中,所述注册交易监听事件模块,包括:The blockchain-based transaction monitoring device according to claim 8, wherein the registered transaction monitoring event module includes:
    注册区块监听事件单元,设置为若对所述交易信息自动注册对应的所述交易监听事件失败时,则对所述交易信息在所述区块链网络中产生的区块注册一个对应的区块监听事件,并将所述交易信息保存在消息队列中;The registration block monitoring event unit is configured to register a corresponding area for a block generated by the transaction information in the blockchain network if the transaction monitoring event corresponding to the transaction information is automatically registered failed The block monitors the event and saves the transaction information in the message queue;
    区块监听单元,设置为调用所述区块监听事件,对所述区块进行监听,当所述区块发生区块异常时,在所述消息队列中将所述区块对应的所述交易信息上报给所述智能合约,获取所述智能合约中的告警规则,将所述告警规则对应的处理类型反馈给所述客户端;The block monitoring unit is set to call the block monitoring event to monitor the block, and when the block is abnormal in the block, the transaction corresponding to the block in the message queue Information is reported to the smart contract, the alarm rules in the smart contract are obtained, and the processing type corresponding to the alarm rules is fed back to the client;
    注销监听事件单元,设置为当所述区块在所述区块链网络中完成上链后,自动注销所述区块对应的所述区块监听事件。The logout monitoring event unit is set to automatically cancel the block monitoring event corresponding to the block after the block is completed on the blockchain network.
  11. 根据权利要求10所述的基于区块链的交易监听装置,其中,所述区块监听单元,设置为调用所述区块监听事件,获取所述区块,将所述区块中的交 易信息通过哈希算法计算生成验证哈希值,将所述验证哈希值与所述区块中的当前区块的哈希值进行比较,若不一致,则判断为所述区块发生区块异常;若一致,将所述区块中的前一区块的哈希值、当前区块的哈希值与区块链列表进行比对,判断前一区块的哈希值、当前区块的哈希值是否首尾相连,若不是,则判断为所述区块发生区块异常。The blockchain-based transaction monitoring device according to claim 10, wherein the block monitoring unit is configured to call the block monitoring event to obtain the block and convert the transaction information in the block Calculate and generate a verification hash value through a hash algorithm, compare the verification hash value with the hash value of the current block in the block, and if they are inconsistent, it is determined that the block is abnormal in the block; If they match, the hash value of the previous block in the block and the hash value of the current block are compared with the blockchain list to determine the hash value of the previous block and the hash of the current block Whether the hope value is connected end to end, if not, it is determined that a block abnormality has occurred in the block.
  12. 根据权利要求8所述的基于区块链的交易监听装置,其中,所述监听模块中的所述告警规则包括多项告警触发条件,每项所述告警触发条件对应至少一项所述处理类型;The blockchain-based transaction monitoring device according to claim 8, wherein the alarm rule in the monitoring module includes multiple alarm triggering conditions, each of which corresponds to at least one of the processing types ;
    所述监听模块,还设置为当所述交易信息触发任一一项所述告警触发条件时,获取对应的处理类型,将所述处理类型反馈给所述客户端。The monitoring module is further configured to obtain a corresponding processing type when the transaction information triggers any one of the alarm triggering conditions, and feed back the processing type to the client.
  13. 根据权利要求12所述的基于区块链的交易监听装置,其中,所述监听模块中的所述告警规则还包括与所述处理类型对应的处理执行脚本;The transaction monitoring device based on blockchain according to claim 12, wherein the alarm rule in the monitoring module further includes a processing execution script corresponding to the processing type;
    所述监听模块,还设置为当所述交易信息触发任一一项所述告警触发条件时,调用所述处理执行脚本,自动进行告警处理,并将处理结果和所述处理类型一起反馈给所述客户端。The monitoring module is further configured to call the processing execution script when the transaction information triggers any one of the alarm triggering conditions, automatically perform alarm processing, and feed back the processing result together with the processing type to the Scription client.
  14. 根据权利要求8所述的基于区块链的交易监听装置,其中,所述注册交易监听事件模块,设置为调用预设的EventHub事件处理中心进行自动注册所述交易监听事件;The blockchain-based transaction monitoring device according to claim 8, wherein the registered transaction monitoring event module is configured to call a preset EventHub event processing center to automatically register the transaction monitoring event;
    所述注销交易监听事件模块,设置为调用所述EventHub中的unregisterTxEvent事件来注销所述交易监听事件。The unregistered transaction monitoring event module is set to call the unregisterTxEvent event in the EventHub to unregister the transaction monitoring event.
  15. 一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行以下步骤:A computer device includes a memory and a processor. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor is caused to perform the following steps:
    获取区块链网络中的客户端发起的交易信息,对每笔所述交易信息自动注册一个对应的交易监听事件;Obtain the transaction information initiated by the client in the blockchain network, and automatically register a corresponding transaction monitoring event for each transaction information;
    调用所述交易监听事件,对每笔所述交易信息进行监听,当所述交易信息发生交易异常时,将所述交易信息上报给所述区块链网络的智能合约,获取所述智能合约中的告警规则,将所述告警规则对应的处理类型反馈给所述客户端;Invoking the transaction monitoring event to monitor each transaction information, when the transaction information is abnormal, report the transaction information to the smart contract of the blockchain network to obtain the smart contract The alarm rule of the system, and feed back the processing type corresponding to the alarm rule to the client;
    当所述交易信息在所述区块链网络中完成交易后,自动注销所述交易信息对应的所述交易监听事件。When the transaction information completes the transaction in the blockchain network, the transaction monitoring event corresponding to the transaction information is automatically cancelled.
  16. 根据权利要求15所述的计算机设备,其中,对每笔所述交易信息自动注册一个对应的交易监听事件时,使得所述处理器执行以下步骤:The computer device according to claim 15, wherein when automatically registering a corresponding transaction monitoring event for each transaction information, the processor is caused to perform the following steps:
    若对所述交易信息自动注册对应的所述交易监听事件失败时,则对所述交易信息在所述区块链网络中产生的区块注册一个对应的区块监听事件,并将所述交易信息保存在消息队列中;If the automatic registration of the transaction monitoring event corresponding to the transaction information fails, register a corresponding block monitoring event for the block generated by the transaction information in the blockchain network, and transfer the transaction The information is saved in the message queue;
    调用所述区块监听事件,对所述区块进行监听,当所述区块发生区块异常时,在所述消息队列中将所述区块对应的所述交易信息上报给所述智能合约,获取所述智能合约中的告警规则,将所述告警规则对应的处理类型反馈给所述客户端;Call the block monitoring event to monitor the block, and when a block exception occurs in the block, report the transaction information corresponding to the block to the smart contract in the message queue , Obtaining the alarm rule in the smart contract, and feeding back the processing type corresponding to the alarm rule to the client;
    当所述区块在所述区块链网络中完成上链后,自动注销所述区块对应的所述区块监听事件。When the block is completely uploaded on the blockchain network, the block monitoring event corresponding to the block is automatically cancelled.
  17. 根据权利要求16所述的计算机设备,其中,所述调用所述区块监听事件,对所述区块进行监听时,使得所述处理器执行以下步骤:The computer device according to claim 16, wherein, when the block monitoring event is invoked to monitor the block, the processor is caused to perform the following steps:
    调用所述区块监听事件,获取所述区块,将所述区块中的交易信息通过哈希算法计算生成验证哈希值,将所述验证哈希值与所述区块中的当前区块的哈希值进行比较,若不一致,则判断为所述区块发生区块异常;Call the block monitoring event to obtain the block, calculate the transaction information in the block by a hash algorithm to generate a verification hash value, and compare the verification hash value with the current area in the block The hash values of the blocks are compared, and if they are inconsistent, it is determined that a block abnormality has occurred in the block;
    若一致,将所述区块中的前一区块的哈希值、当前区块的哈希值与区块链列表进行比对,判断前一区块的哈希值、当前区块的哈希值是否首尾相连,若不是,则判断为所述区块发生区块异常。If they match, the hash value of the previous block in the block and the hash value of the current block are compared with the blockchain list to determine the hash value of the previous block and the hash of the current block Whether the hope value is connected end to end, if not, it is determined that a block abnormality has occurred in the block.
  18. 一种存储有计算机可读指令的存储介质,所述计算机可读指令被一个 或多个处理器执行时,使得一个或多个处理器执行以下步骤:A storage medium storing computer-readable instructions, which when executed by one or more processors, causes the one or more processors to perform the following steps:
    获取区块链网络中的客户端发起的交易信息,对每笔所述交易信息自动注册一个对应的交易监听事件;Obtain the transaction information initiated by the client in the blockchain network, and automatically register a corresponding transaction monitoring event for each transaction information;
    调用所述交易监听事件,对每笔所述交易信息进行监听,当所述交易信息发生交易异常时,将所述交易信息上报给所述区块链网络的智能合约,获取所述智能合约中的告警规则,将所述告警规则对应的处理类型反馈给所述客户端;Invoking the transaction monitoring event to monitor each transaction information, when the transaction information is abnormal, report the transaction information to the smart contract of the blockchain network to obtain the smart contract The alarm rule of the system, and feed back the processing type corresponding to the alarm rule to the client;
    当所述交易信息在所述区块链网络中完成交易后,自动注销所述交易信息对应的所述交易监听事件。When the transaction information completes the transaction in the blockchain network, the transaction monitoring event corresponding to the transaction information is automatically cancelled.
  19. 根据权利要求18所述的存储介质,其中,对每笔所述交易信息自动注册一个对应的交易监听事件时,使得一个或多个所述处理器执行以下步骤:The storage medium according to claim 18, wherein when automatically registering a corresponding transaction monitoring event for each of the transaction information, causing one or more of the processors to perform the following steps:
    若对所述交易信息自动注册对应的所述交易监听事件失败时,则对所述交易信息在所述区块链网络中产生的区块注册一个对应的区块监听事件,并将所述交易信息保存在消息队列中;If the automatic registration of the transaction monitoring event corresponding to the transaction information fails, register a corresponding block monitoring event for the block generated by the transaction information in the blockchain network, and transfer the transaction The information is saved in the message queue;
    调用所述区块监听事件,对所述区块进行监听,当所述区块发生区块异常时,在所述消息队列中将所述区块对应的所述交易信息上报给所述智能合约,获取所述智能合约中的告警规则,将所述告警规则对应的处理类型反馈给所述客户端;Call the block monitoring event to monitor the block, and when a block exception occurs in the block, report the transaction information corresponding to the block to the smart contract in the message queue , Obtaining the alarm rule in the smart contract, and feeding back the processing type corresponding to the alarm rule to the client;
    当所述区块在所述区块链网络中完成上链后,自动注销所述区块对应的所述区块监听事件。When the block is completely uploaded on the blockchain network, the block monitoring event corresponding to the block is automatically cancelled.
  20. 根据权利要求18所述的存储介质,其中,所述调用所述区块监听事件,对所述区块进行监听时,使得一个或多个所述处理器执行以下步骤:The storage medium according to claim 18, wherein when the block monitoring event is invoked to monitor the block, one or more of the processors perform the following steps:
    调用所述区块监听事件,获取所述区块,将所述区块中的交易信息通过哈希算法计算生成验证哈希值,将所述验证哈希值与所述区块中的当前区块的哈希值进行比较,若不一致,则判断为所述区块发生区块异常;Call the block monitoring event to obtain the block, calculate the transaction information in the block by a hash algorithm to generate a verification hash value, and compare the verification hash value with the current area in the block The hash values of the blocks are compared, and if they are inconsistent, it is determined that a block abnormality has occurred in the block;
    若一致,将所述区块中的前一区块的哈希值、当前区块的哈希值与区块链 列表进行比对,判断前一区块的哈希值、当前区块的哈希值是否首尾相连,若不是,则判断为所述区块发生区块异常。If they match, the hash value of the previous block in the block and the hash value of the current block are compared with the blockchain list to determine the hash value of the previous block and the hash of the current block Whether the hope value is connected end to end, if not, it is determined that a block abnormality has occurred in the block.
PCT/CN2018/124621 2018-10-29 2018-12-28 Block chain-based transaction detecting method, apparatus, device, and storage medium WO2020087739A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811265445.7A CN109670950B (en) 2018-10-29 2018-10-29 Transaction monitoring method, device, equipment and storage medium based on blockchain
CN201811265445.7 2018-10-29

Publications (1)

Publication Number Publication Date
WO2020087739A1 true WO2020087739A1 (en) 2020-05-07

Family

ID=66141715

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/124621 WO2020087739A1 (en) 2018-10-29 2018-12-28 Block chain-based transaction detecting method, apparatus, device, and storage medium

Country Status (2)

Country Link
CN (1) CN109670950B (en)
WO (1) WO2020087739A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111563002A (en) * 2020-05-15 2020-08-21 中国工商银行股份有限公司 Transaction fault processing method and device, electronic equipment and storage medium
CN113760651A (en) * 2021-08-12 2021-12-07 熵链科技(福建)有限公司 Method, system and storage medium for collecting running state of main sub-chain of block chain
CN113836564A (en) * 2021-09-30 2021-12-24 中汽创智科技有限公司 Block chain-based networked automobile information safety system
US11489717B2 (en) 2020-07-08 2022-11-01 Alipay (Hangzhou) Information Technology Co., Ltd. Method, apparatus, and electronic device for transaction link exception handling
WO2024022242A1 (en) * 2022-07-25 2024-02-01 天津理工大学 Bitcoin transaction autonomy message extraction and analysis method

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110659142A (en) * 2019-08-02 2020-01-07 平安科技(深圳)有限公司 Message queue processing method and device, electronic equipment and storage medium
CN111127208A (en) * 2019-12-30 2020-05-08 上海金仕达软件科技有限公司 Abnormal transaction real-time monitoring system and calculation method
CN111369221B (en) * 2020-03-09 2023-07-04 浙江大学 Intelligent contract monitoring method and system for block chain supervision
CN111475520B (en) * 2020-04-10 2022-05-13 厦门慢雾科技有限公司 Method and system for automatically monitoring and alarming block data
CN112949985B (en) * 2021-02-01 2023-08-11 南方电网能源发展研究院有限责任公司 Power grid engineering supervision method and device based on block chain and computer equipment
CN112837155B (en) * 2021-02-10 2024-05-31 中国人民银行数字货币研究所 Method and device for registering and executing intelligent contracts in blockchain
CN113282864A (en) * 2021-06-15 2021-08-20 支付宝(杭州)信息技术有限公司 Webpage processing method and system
CN113572812A (en) * 2021-06-21 2021-10-29 中盾创新档案管理(北京)有限公司 File block synchronization method based on distributed cloud platform
CN113590354A (en) * 2021-07-30 2021-11-02 工银科技有限公司 Block chain-based information push method, apparatus, device, medium, and program product
CN113672463A (en) * 2021-08-20 2021-11-19 工银科技有限公司 Block chain monitoring method, device, equipment, storage medium and program product
CN113722125B (en) * 2021-09-08 2024-01-26 浙江中控技术股份有限公司 Data processing method and system based on distributed subscription and release network
CN113761559A (en) * 2021-09-08 2021-12-07 霍普智库(南京)信息科技有限公司 AI training data storage management system based on block chain
CN113849563A (en) * 2021-09-24 2021-12-28 中国农业银行股份有限公司 Information sharing method, device and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170293503A1 (en) * 2016-04-10 2017-10-12 Bank Of America Corporation System for transforming large scale electronic processing using application block chain and multi-structured data stores
CN107819749A (en) * 2017-10-26 2018-03-20 平安科技(深圳)有限公司 Block catenary system and transaction data processing method based on ether mill
CN107862600A (en) * 2017-10-24 2018-03-30 深圳四方精创资讯股份有限公司 Bank transfer method and its system based on block chain
US20180096121A1 (en) * 2016-09-30 2018-04-05 Cable Television Laboratories, Inc Systems and methods for secure person to device association

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106506203B (en) * 2016-10-25 2019-12-10 杭州云象网络技术有限公司 Node monitoring system applied to block chain
CN106951185B (en) * 2017-03-01 2019-12-06 武汉爱宁智慧科技有限公司 health detection data management system and method based on block chain technology
KR101814989B1 (en) * 2017-07-06 2018-01-05 주식회사 케이뱅크은행 Method of detecting fraud financial trade and server performing the same

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170293503A1 (en) * 2016-04-10 2017-10-12 Bank Of America Corporation System for transforming large scale electronic processing using application block chain and multi-structured data stores
US20180096121A1 (en) * 2016-09-30 2018-04-05 Cable Television Laboratories, Inc Systems and methods for secure person to device association
CN107862600A (en) * 2017-10-24 2018-03-30 深圳四方精创资讯股份有限公司 Bank transfer method and its system based on block chain
CN107819749A (en) * 2017-10-26 2018-03-20 平安科技(深圳)有限公司 Block catenary system and transaction data processing method based on ether mill

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111563002A (en) * 2020-05-15 2020-08-21 中国工商银行股份有限公司 Transaction fault processing method and device, electronic equipment and storage medium
CN111563002B (en) * 2020-05-15 2023-07-25 中国工商银行股份有限公司 Transaction fault processing method and device, electronic equipment and storage medium
US11489717B2 (en) 2020-07-08 2022-11-01 Alipay (Hangzhou) Information Technology Co., Ltd. Method, apparatus, and electronic device for transaction link exception handling
CN113760651A (en) * 2021-08-12 2021-12-07 熵链科技(福建)有限公司 Method, system and storage medium for collecting running state of main sub-chain of block chain
CN113760651B (en) * 2021-08-12 2024-04-02 熵链科技(福建)有限公司 Main sub-chain running state collection method, system and storage medium of block chain
CN113836564A (en) * 2021-09-30 2021-12-24 中汽创智科技有限公司 Block chain-based networked automobile information safety system
WO2024022242A1 (en) * 2022-07-25 2024-02-01 天津理工大学 Bitcoin transaction autonomy message extraction and analysis method

Also Published As

Publication number Publication date
CN109670950B (en) 2023-09-15
CN109670950A (en) 2019-04-23

Similar Documents

Publication Publication Date Title
WO2020087739A1 (en) Block chain-based transaction detecting method, apparatus, device, and storage medium
US11297088B2 (en) System and method for comprehensive data loss prevention and compliance management
US20210092150A1 (en) Advanced cybersecurity threat mitigation using behavioral and deep analytics
US11570209B2 (en) Detecting and mitigating attacks using forged authentication objects within a domain
US11416456B2 (en) Method, apparatus, and computer program product for data quality analysis
US11968227B2 (en) Detecting KERBEROS ticket attacks within a domain
US10609079B2 (en) Application of advanced cybersecurity threat mitigation to rogue devices, privilege escalation, and risk-based vulnerability and patch management
US10764031B2 (en) Blockchain system for pattern recognition
US20220377093A1 (en) System and method for data compliance and prevention with threat detection and response
US20170235970A1 (en) Scalable data verification with immutable data storage
US20220263860A1 (en) Advanced cybersecurity threat hunting using behavioral and deep analytics
US20160164893A1 (en) Event management systems
WO2020024376A1 (en) Method and device for processing operation and maintenance monitoring alarm
US11074652B2 (en) System and method for model-based prediction using a distributed computational graph workflow
CN111698126B (en) Information monitoring method, system and computer readable storage medium
EP4004768A2 (en) Detection and prevention of malicious script attacks using behavioral analysis of run-time script execution events
US11627164B2 (en) Multi-perspective security context per actor
US11144645B2 (en) Blockchain technique for immutable source control
WO2024000988A1 (en) Blockchain monitoring method and apparatus, device, and storage medium
CN112668998B (en) Flow implementation method, device, system, electronic equipment and readable storage medium
CN114003414B (en) Service return visit processing method and device, computer equipment and storage medium
CN116627681B (en) Service request processing method, device, computer equipment, medium and program product
CN114168413A (en) Server operation and maintenance processing method and device based on block chain and computer equipment
CN117176815A (en) Data transmission method, device, computer equipment and storage medium
EP2739010A1 (en) Method for improving reliability of distributed computer systems based on service-oriented architecture

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18939095

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18939095

Country of ref document: EP

Kind code of ref document: A1