Blockchain-based Information Push Method, Device, Equipment, Medium and Program Product
Through the first node of the blockchain system, the monitoring event is actively obtained and notification information is pushed, which solves the problem of data query delay in off-chain business systems, and realizes timely transmission and efficient acquisition of information.
Patent Information
- Application Number
- CN202110868759.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-30
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2041-07-30
AI Technical Summary
In the prior art, there is a delay in querying blockchain data by off-chain business systems, resulting in low information acquisition efficiency.
The first node of the blockchain system actively obtains the monitoring event, and generates notification information based on the monitoring event, and pushes it to M business systems to realize the active triggering and timely notification of information.
It improves the efficiency of the off-chain business system to obtain information, decouple the coupling between the blockchain system and the off-chain business system, and reduces the difficulty of docking.
Smart Images

Figure CN113590354B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of blockchain or finance, and more particularly to a method, apparatus, device, medium, and program product for information push based on blockchain. Background Art
[0002] Due to the design concept of blockchain technology, blockchain is a deterministic and closed system environment with high security and reliability. Usually, a blockchain system cannot establish a connection with an off-chain business system, let alone transmit data to an off-chain business system. In related technologies, when an off-chain business system needs to obtain data of a blockchain system, it needs to dock with the blockchain system and then actively query the data in the blockchain at regular intervals.
[0003] In the process of implementing the concept of the present disclosure, the inventors found that there are at least the following problems in related technologies:
[0004] The current solution for an off-chain business system to query data in the blockchain cannot obtain the required data content in a timely manner. Due to a certain delay, the efficiency of the off-chain business system in obtaining information from the blockchain is low. Summary of the Invention
[0005] In view of the above problems, the present disclosure provides a method, apparatus, device, medium, and program product for information push in which a blockchain system can actively push information to an off-chain business system.
[0006] An aspect of an embodiment of the present disclosure provides a method for information push based on blockchain, which is applied to a first node of a blockchain system. The information push method includes: obtaining a listening event in the blockchain system, where the listening event includes an event generated by the blockchain system invoking at least one target smart contract; in the case of obtaining the listening event, obtaining first notification information based on the listening event; and notifying M business systems based on the first notification information, where M is an integer greater than or equal to 1.
[0007] According to an embodiment of the present disclosure, notifying M business systems based on the first notification information includes: pushing the first notification information to a notification end so that the notification end notifies the M business systems based on the first notification information.
[0008] According to an embodiment of the present disclosure, the method further includes: receiving response information sent by the notification end, where the response information includes information returned by at least one target business system among the M business systems after receiving the notification; and updating the notification status of specific transaction information in the blockchain based on the response information, where the specific transaction information is associated with the listening event.
[0009] According to an embodiment of the present disclosure, in the case where one or more of the response information indicates a notification failure, the second notification information sent by the notification end is received, where the second notification information is obtained by the notification end based on the first notification information; and the second notification information is uploaded to the blockchain.
[0010] According to an embodiment of the present disclosure, obtaining the monitoring event packet in the blockchain system includes: real-time obtaining the latest block uploaded to the blockchain; querying the monitoring identifier of the monitoring event from the latest block based on a preset condition, where the preset condition includes information of the at least one target smart contract.
[0011] According to an embodiment of the present disclosure, the blockchain system invoking at least one target smart contract includes: obtaining specific transaction information submitted by a user; invoking the at least one target smart contract to process the specific transaction information; where the at least one target smart contract processing the specific transaction information includes: generating a corresponding monitoring event based on the specific transaction information.
[0012] According to an embodiment of the present disclosure, obtaining the first notification information based on the monitoring event includes: determining the corresponding specific transaction information according to the monitoring event; and obtaining the first notification information based on the specific transaction information.
[0013] Another aspect of the embodiments of the present disclosure provides an information push method based on a blockchain, which is applied to a notification end. The information push method includes: receiving first notification information sent by a first node of the blockchain system, where the first notification information is obtained by the first node based on a monitoring event in the blockchain system, and the monitoring event includes an event generated by the blockchain system invoking at least one target smart contract; obtaining second notification information based on the first notification information; and pushing the second notification information to M service systems, where M is an integer greater than or equal to 1.
[0014] According to an embodiment of the present disclosure, obtaining the second notification information based on the first notification information includes: parsing the first notification information to obtain positioning data of the specific transaction information, where the positioning data includes the block position of the specific transaction information in the blockchain; obtaining the specific transaction information from a target block according to the positioning data, where the blockchain includes the target block, and the position of the target block is the block position; and obtaining the second notification information based on the specific transaction information.
[0015] According to an embodiment of the present disclosure, the M service systems include at least one target service system, and obtaining the second notification information based on the specific transaction information includes: obtaining the at least one target service system involved from the specific transaction information; and obtaining the second notification information based on a push format agreed with the at least one target service system.
[0016] According to an embodiment of the present disclosure, the M service systems include at least one target service system. After pushing the second notification information to the M service systems, the method further includes: receiving response information returned by each target service system; and sending the response information and / or the second notification information to the first node, so that the first node updates the notification status of the specific transaction information in the blockchain based on the response information.
[0017] According to an embodiment of the present disclosure, after receiving the response information returned by each target service system, it further includes: when there is one or more pieces of the response information indicating notification failure, looping to execute the following operations until all notifications are successful: recording the second notification information and the address information of the target service system with notification failure in a first file; and resending the notification at regular intervals based on the second notification information and the address information.
[0018] Another aspect of the embodiments of the present disclosure provides an information push device based on a blockchain, which is applied to a first node of a blockchain system. The information push device includes: a first acquisition module configured to acquire a listening event in the blockchain system, where the listening event includes an event generated by the blockchain system invoking at least one target smart contract; a second acquisition module configured to obtain first notification information based on the listening event when the listening event is acquired; and a first notification module configured to notify M service systems based on the first notification information, where M is an integer greater than or equal to 1.
[0019] Another aspect of the embodiments of the present disclosure provides an information push device based on a blockchain, which is applied to a notification end. The information push device includes: a data reception module configured to receive first notification information sent by a first node of a blockchain system, where the first notification information is obtained by the first node based on a listening event in the blockchain system, and the listening event includes an event generated by the blockchain system invoking at least one target smart contract; a third acquisition module configured to obtain second notification information based on the first notification information; and a second notification module configured to push the second notification information to M service systems, where M is an integer greater than or equal to 1.
[0020] Another aspect of the embodiments of the present disclosure provides an electronic device, including: one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors are caused to execute the method as described above.
[0021] Another aspect of the embodiments of the present disclosure further provides a computer-readable storage medium, on which executable instructions are stored, and when the instructions are executed by a processor, the processor is caused to execute the method as described above.
[0022] Another aspect of the embodiments of the present disclosure further provides a computer program product, including a computer program, and when the computer program is executed by a processor, the method as described above is implemented.
[0023] The above one or more embodiments have the following advantages or beneficial effects: It can at least partially solve the problem of delay in obtaining data in the blockchain by the off-chain business system. The first node of the blockchain system is used to obtain the listening events in the blockchain system. If a listening event is obtained, it indicates that there is data that can be pushed in the blockchain. Therefore, the M business systems can be notified based on the first notification information, so that the way of passively accepting queries for blockchain data in the related art can be changed to an actively triggered push method. The first node can timely discover the information that can be notified and notify it in the first time, improving the efficiency of the off-chain business system in obtaining information. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Through the following description of the embodiments of the present disclosure with reference to the drawings, the above content and other objects, features and advantages of the present disclosure will be more clearly understood. In the drawings:
[0025] Figure 1 Schematically shows an application scenario diagram suitable for implementing a blockchain-based information push method applied to a first node and a notification end according to an embodiment of the present disclosure;
[0026] Figure 2 Schematically shows a flowchart of an information push method applied to a first node according to an embodiment of the present disclosure;
[0027] Figure 3 Schematically shows a flowchart of obtaining a listening event according to an embodiment of the present disclosure;
[0028] Figure 4 Schematically shows a flowchart of generating a listening event according to an embodiment of the present disclosure;
[0029] Figure 5 Schematically shows a flowchart of obtaining the first notification information according to an embodiment of the present disclosure;
[0030] Figure 6 Schematically shows a flowchart of an information push method applied to a first node according to another embodiment of the present disclosure;
[0031] Figure 7 Schematically shows a flowchart of a first node receiving response information according to an embodiment of the present disclosure;
[0032] Figure 8 Schematically shows a flowchart of an information push method applied to a notification end according to an embodiment of the present disclosure;
[0033] Figure 9 Schematically shows a flowchart of obtaining a second notification information based on a first notification information according to an embodiment of the present disclosure;
[0034] Figure 10 Schematically shows a flowchart of obtaining a second notification information based on specific transaction information according to an embodiment of the present disclosure;
[0035] Figure 11 Schematically shows a flowchart of a notification end receiving response information according to an embodiment of the present disclosure;
[0036] Figure 12 Schematically shows a flowchart of pushing a second notification information according to an embodiment of the present disclosure;
[0037] Figure 13 Schematically shows a block diagram of a blockchain-based information push device applied to a first node according to an embodiment of the present disclosure;
[0038] Figure 14 Schematically shows a block diagram of a blockchain-based information push device applied to a notification end according to an embodiment of the present disclosure; and
[0039] Figure 15 Schematically shows a block diagram of an electronic device suitable for implementing a blockchain-based information push method applied to a first node and a notification end according to an embodiment of the present disclosure. Detailed implementation manners
[0040] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for the sake of explanation, many specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure. However, it is obvious that one or more embodiments can be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts of the present disclosure.
[0041] Embodiments of the present disclosure provide a blockchain-based information push method, apparatus, device, medium, and program product, which are applied to the first node of a blockchain system. The information push method includes: obtaining a monitoring event in the blockchain system, where the monitoring event includes an event generated by the blockchain system invoking at least one target smart contract. When the monitoring event is obtained, first notification information is obtained based on the monitoring event. M service systems are notified based on the first notification information, where M is an integer greater than or equal to 1. Embodiments of the present disclosure also provide a blockchain-based information push method, apparatus, device, medium, and program product, which are applied to a notification end.
[0042] In the related art, in order for an off-chain service system to obtain data in a blockchain system, it is necessary to dock with the blockchain system and actively query block data regularly.
[0043] According to the embodiments of the present disclosure, by obtaining a monitoring event in the blockchain system through the first node of the blockchain system, if the monitoring event is obtained, it indicates that there is data that can be pushed in the blockchain. Therefore, M service systems can be notified based on the first notification information, so that the passive query method of blockchain data in the related art can be changed to an active trigger push method. The first node can timely discover the information that can be notified and notify it in the first time, improving the efficiency of the off-chain service system to obtain information.
[0044] It should be noted that the blockchain-based information push method, apparatus, device, medium, and program product provided in the embodiments of the present disclosure and applied to the first node of the blockchain system or the notification end can be used in aspects related to data transmission and interaction in blockchain technology, and can also be used in various fields other than blockchain technology, such as the financial field. The application fields of the blockchain-based information push method, apparatus, device, medium, and program product provided in the embodiments of the present disclosure are not limited.
[0045] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision, or application of the data of the blockchain system or the block data in the blockchain all comply with the provisions of relevant laws and regulations, take necessary confidentiality measures, and do not violate public order and good customs.
[0046] Figure 1 Schematically shows an application scenario diagram suitable for implementing the blockchain-based information push method applied to the first node and the notification end according to the embodiments of the present disclosure.
[0047] As Figure 1As shown, the application scenario 100 according to this embodiment may include a blockchain system 110, terminal devices 121, 122, 123, networks 131, 132, 133, a notification server 140, and M business servers (such as the first server 1501, the second server 1502... the Mth server 150M).
[0048] The blockchain system 110 may include nodes 111, 112, 113, 114, 115, etc., and a blockchain 116. The blockchain system 110 may allow users (such as financial institutions, customers, or business personnel, etc.) to access as a node. Nodes 111, 112, 113, 114, 115, etc. may form a blockchain network, such as a peer-to-peer (P2P) network. The blockchain 116 may include blocks A, B, C, D, etc. Each block may include a timestamp, the hash value of the previous block, the hash value of the current block, and block data. The block data may include the transaction data of users, such as information on user payment transfers, receipts, regular financial management, currency exchange, and other services. Among them, nodes 111, 112, 113, 114, 115, etc. may be set in different servers and each has a node client. Through the node client, processes such as contract invocation, event push, data processing, and account status change can be displayed. In related technologies, the node client is part of the blockchain system and cannot interact with off-chain devices for data.
[0049] Users can use the terminal devices 121, 122, 123 to interact with the notification server 140 through the network 131 to receive or send messages, etc. Various communication client applications may be installed on the terminal devices 121, 122, 123, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example). The terminal devices 121, 122, 123 may be various electronic devices with a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop computers, and desktop computers, etc.
[0050] The network 131 is a medium for providing a communication link between the terminal devices 121, 122, 123 and the notification server 140. The network 132 is a medium for providing a communication link between the node 111 and the notification server 140. The network 133 is a medium for providing a communication link between the notification server 140 and any one of the M business servers. The networks 131, 132, 133 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0051] A notification server 140 may deploy a notification end. The notification end uses the IP address and port of the node 111 to listen for the node 111 to obtain block data in the blockchain 116. When the node 111 learns of a listening event for invoking a target smart contract, it exposes it to the notification end through the port. The notification server 140 may be a server that provides various services. For example, it may be a back-end management server (only an example) that supports websites browsed by users using the terminal devices 121, 122, and 123. The back-end management server may analyze and process data such as user requests received, and feedback the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices. In some embodiments, any one of the first server 1501, the second server 1502... the Mth server 150M may replace the notification server 140 to perform the above operations.
[0052] The M business servers may have the same or different hardware as the notification server 140. A first off-chain business system, a second off-chain business system... an Mth off-chain business system may be respectively deployed in the first server 1501, the second server 1502... the Mth server 150M. Among them, the off-chain business system refers to the off-chain relative to the blockchain system 110, and it may include other blockchain systems or non-blockchain systems.
[0053] In the embodiments of the present disclosure, each node in the blockchain system may perform operations such as verifying transaction information and uploading it to the chain based on multiple pre-set smart contracts. A smart contract is, for example, a digital contract or an intelligent contract, which is a computing protocol constructed by code for a contract. When external conditions change to meet the predetermined terms, the smart contract will automatically execute. Copies of the smart contract may be stored in the blockchain 116, and nodes 111, 112, 113, 114, and 115 etc. may all store the blockchain 116. Therefore, each node can access and invoke the smart contract. Among them, uploading to the chain means that data is packaged in a block according to the rules of the blockchain system, and the block becomes a new block and is linked to the previous block, becoming immutable data on the blockchain.
[0054] It should be noted that the blockchain-based information push method applied to the first node provided in the embodiments of the present disclosure can generally be executed by the first node. Correspondingly, the blockchain-based notification device applied to the first node provided in the embodiments of the present disclosure can generally be set in the first node. The blockchain-based information push method applied to the first node provided in the embodiments of the present disclosure can also be executed by a server or a server cluster different from the first node and capable of communicating with the notification server 140 and / or the first node. Correspondingly, the blockchain-based notification device applied to the first node provided in the embodiments of the present disclosure can also be set in a server or a server cluster different from the first node and capable of communicating with the notification server 140 and / or the first node.
[0055] It should be noted that the blockchain-based information push method applied to the notification end provided in the embodiments of the present disclosure can generally be executed by the notification server 140. Correspondingly, the blockchain-based notification device applied to the notification end provided in the embodiments of the present disclosure can generally be set in the notification server 140. The blockchain-based information push method applied to the notification end provided in the embodiments of the present disclosure can also be executed by a server or a server cluster different from the notification server 140 and capable of communicating with the terminal devices 121, 122, 123 and / or the notification server 140. Correspondingly, the blockchain-based notification device applied to the notification end provided in the embodiments of the present disclosure can also be set in a server or a server cluster different from the notification server 140 and capable of communicating with the terminal devices 121, 122, 123 and / or the notification server 140.
[0056] It should be understood that Figure 1 the numbers of nodes, terminal devices, networks, and servers in
[0057] are merely illustrative. According to actual needs, there can be any number of nodes, terminal devices, networks, and servers. Figure 1 Based on the Figures 2 to 12 scenario described below, the information notification methods applied to the first node and the server end in the embodiments of the present disclosure will be described in detail through
[0058] Figure 2 FIG. schematically shows a flowchart of the information push method applied to the first node according to the embodiments of the present disclosure.
[0059] As Figure 2 shown, the information push method applied to the first node in this embodiment includes operations S210 to S230.
[0060] In operation S210, obtain monitoring events in the blockchain system, where the monitoring events include events generated by the blockchain system invoking at least one target smart contract.
[0061] According to an embodiment of the present disclosure, when programming the target smart contract, it can be set that invoking the target smart contract triggers the generation of a monitoring event.
[0062] Refer to Figure 1 , for example, in the scenario of fund supervision, where node 112 is a user node, node 113 is an enterprise A node, node 114 is a bank B node, and node 115 is a bank C node. The business server 1501 can deploy an off-chain business system of bank B. The business server 1502 can deploy an off-chain business system of bank C.
[0063] First, the user sends a payment transaction (only an example) using the bank account of bank B through node 112.
[0064] Then, node 112 sends the payment transaction to the blockchain network.
[0065] Next, after the corresponding node (such as a consensus node) obtains the payment transaction, it invokes a target smart contract for processing, such as verification. When invoking the target smart contract for processing, a monitoring event is triggered and generated. Among them, the monitoring event can be sent to node 111 at the time of generation, and then node 111 sends the monitoring event to the notification end through the port.
[0066] Finally, after processing the payment transaction, an on-chain operation is performed, such as writing to block D.
[0067] In operation S220, in the case of obtaining a monitoring event, obtain first notification information based on the monitoring event.
[0068] In some embodiments of the present disclosure, when generating a monitoring event, information such as the name of the target smart contract, user account, business name, amount, bank, etc. can be written into an event. The first node can directly parse and process according to the data structure of the monitoring event, and then obtain the first notification information.
[0069] In other embodiments of the present disclosure, when generating a monitoring event, a trigger identifier can be generated, and there is no information such as a smart contract, user, or transaction. The first node determines that the blockchain system has an action of invoking the target smart contract according to the trigger identifier, and then obtains the first notification information based on the monitoring event.
[0070] In operation S230, notify M business systems based on the first notification information, where M is an integer greater than or equal to 1.
[0071] According to an embodiment of the present disclosure, the first node of the blockchain system obtains monitoring events in the blockchain system. If a monitoring event is obtained, it indicates that there is data that can be pushed in the blockchain. Therefore, the M business systems can be notified based on the first notification information, so that the passive query method of blockchain data in the related technology can be changed to an active trigger push method. The first node can timely discover the information that can be notified and notify it in the first time, improving the efficiency of the off-chain business system to obtain information.
[0072] In some other embodiments of the present disclosure, obtaining the monitoring event in operation S210 may be the following operations: First, when calling the target smart contract for processing, a monitoring event is triggered and generated, and a monitoring identifier is generated. At this time, it is not directly sent to the first node, but is chained together with the processed transaction information for storage in the blockchain. Then, the first node can obtain the monitoring event as Figure 3 shown in the operations.
[0073] Figure 3 FIG. schematically shows a flowchart of obtaining a monitoring event in operation S210 according to an embodiment of the present disclosure.
[0074] As Figure 3 shown, obtaining the monitoring event in operation S210 of this embodiment includes operations S310 to S320.
[0075] In operation S310, the latest block chained in the blockchain is obtained in real time.
[0076] In operation S320, the monitoring identifier of the monitoring event is queried from the latest block based on a preset condition, where the preset condition includes information of at least one target smart contract.
[0077] According to an embodiment of the present disclosure, an event listener can be set on the first node, such as a block listener, a transaction listener, or a chain code listener, etc. Taking the transaction listener as an example, when the latest block is submitted to the blockchain network, the first node will be notified. Then, it is queried whether there is a monitoring identifier of the monitoring event in the latest block. Then, after the monitoring identifier is queried, it can be determined that a monitoring event is obtained, where the monitoring identifier can be a monitoring field returned by the target smart contract through a function. The monitoring field can be configured according to the preset conditions in the configuration file.
[0078] Among them, the preset conditions may include at least one name of the target smart contract, at least one monitoring identifier generated by the target smart contract, the relationship between at least one monitoring identifier generated by the target smart contract and the processed transaction information, etc.
[0079] According to an embodiment of the present disclosure, every time a block is chained in the blockchain, the first node can obtain the block data of the latest block in real time, where the block data includes multiple pieces of transaction information. The first node can query the listening identifier from the block data to determine whether there is transaction information that can be actively pushed, thereby ensuring the timeliness of the pushed information.
[0080] Figure 4 Schematically shows a flowchart of generating a listening event according to an embodiment of the present disclosure.
[0081] As Figure 4 shown, the listening event includes an event generated by the blockchain system invoking at least one target smart contract, where generating the listening event includes operations S410 to S420.
[0082] In operation S410, obtain specific transaction information submitted by the user.
[0083] According to an embodiment of the present disclosure, referring to Figure 1 , the user can send a payment transaction using the bank account of Bank B through node 112. Among them, the specific transaction information can be formulated according to the requirements of each business system. For example, the business system of Bank B can set the specific transaction information as payment transaction or receipt transaction and other information.
[0084] In operation S420, invoke at least one target smart contract to process the specific transaction information.
[0085] According to an embodiment of the present disclosure, at least one target smart contract processing the specific transaction information includes: generating a corresponding listening event based on the specific transaction information.
[0086] Among them, for example, when the specific transaction information is a payment transaction, smart contract x can be invoked for processing. When the specific transaction information is a receipt transaction, smart contract y can be invoked for processing. Generating a corresponding listening event by smart contract x or y can be set when programming the smart contract. When triggering the corresponding event, it can be listened to through the web3j side (only as an example).
[0087] According to an embodiment of the present disclosure, when programming the target smart contract, the types of transaction information processed by the target smart contract can be set to identify the specific transaction information. And set the logic for processing the specific transaction information, such as generating a listening event, a listening identifier, and the data structure of the listening event. The notification end can search whether there is a listening identifier from the block data of each block according to the above data structure (such as a specific field).
[0088] According to an embodiment of the present disclosure, by setting the transaction information that can be notified and generating corresponding listening events when programming the smart contract, when the blockchain network processes the transaction information, corresponding actions can be monitored in a timely manner, and the listening events can be obtained with high efficiency.
[0089] Figure 5 Schematically shows a flowchart of obtaining the first notification information in operation S220 according to an embodiment of the present disclosure.
[0090] As Figure 5 shown, obtaining the first notification information based on the listening event in operation S220 of this embodiment includes operation S510 to operation S520.
[0091] In operation S510, determine the corresponding specific transaction information according to the listening event.
[0092] In operation S520, obtain the first notification information based on the specific transaction information.
[0093] According to an embodiment of the present disclosure, for example, event listeners such as the above-mentioned block listener, transaction listener, or chain code listener are set in the first node. After the listening identifier is queried, the corresponding transaction can be found, and information such as the transaction ID, transaction status, and block height of the transaction is used as the first notification information.
[0094] According to an embodiment of the present disclosure, after obtaining the listening event, the corresponding specific transaction information is obtained, thereby decoupling each process of obtaining the first notification information. Avoid parsing all transaction information in the block data each time, and can obtain the corresponding specific transaction information targeted according to the listening event, reducing the amount of data parsed each time and improving the efficiency of active push.
[0095] Figure 6 Schematically shows a flowchart of an information push method applied to the first node according to another embodiment of the present disclosure.
[0096] As Figure 6 shown, the information push method applied to the first node in this embodiment includes operation S210 to operation S220. In addition, it may further include operation S610.
[0097] In operation S210, obtain the listening events in the blockchain system, where the listening events include events generated by the blockchain system calling at least one target smart contract.
[0098] In operation S220, in the case of obtaining the listening event, obtain the first notification information based on the listening event.
[0099] In operation S610, the first notification information is pushed to the notification end so that the notification end notifies M business systems based on the first notification information.
[0100] In the related art, in order for an off-chain business system to obtain data in a blockchain system, it needs to dock with the blockchain system and actively query. First, during the docking process, technicians of each off-chain business system need to have a high level of blockchain technology, such as being proficient in blockchain data structures, which increases the difficulty of docking for off-chain business systems. Second, each off-chain business system directly docks with the blockchain system. If the blockchain system makes technical or data improvements, each off-chain business system needs to make adaptive changes, resulting in too high a coupling degree.
[0101] According to an embodiment of the present disclosure, the first notification information is obtained through an independent notification end, and then M business systems are notified based on the first notification information. Thereby, the blockchain system and the off-chain business system are decoupled, saving the time and system resources for each off-chain business system to process block data, and improving the efficiency of each off-chain business system to obtain information. In addition, technicians of off-chain business systems can complete the docking with the blockchain system without understanding blockchain technology, reducing the docking difficulty.
[0102] Figure 7 Schematically shows a flowchart of a first node receiving response information according to an embodiment of the present disclosure.
[0103] As Figure 7 shown, the first node receiving the response information may include operation S710 to operation S750.
[0104] In operation S710, receive the response information sent by the notification end, where the response information includes information returned by at least one target business system among the M business systems after receiving the notification.
[0105] According to an embodiment of the present disclosure, an oracle or other service can be set at the first node to receive the response information sent by the notification end.
[0106] In operation S720, update the notification status of specific transaction information in the blockchain based on the response information, where the specific transaction information is associated with the listening event.
[0107] According to an embodiment of the present disclosure, the response information can be feedback information on whether each target business system successfully receives the second notification information. If successfully received, a response information indicating successful notification is returned, and the first node can update the status of the corresponding specific transaction information in the blockchain to the notification success status. Vice versa.
[0108] According to an embodiment of the present disclosure, updating the status of specific transaction information in a blockchain enables each node to trace the information, understand the processing process and current status of each transaction, and can notify the user based on the updated status, so that the user can timely understand the processing situation of the transaction.
[0109] In operation S730, it is determined whether all the target business systems have been successfully notified. If so, the process ends. If not, operation S740 is executed.
[0110] In operation S740, in the case where one or more response messages indicate notification failure, the second notification message sent by the notification end is received, where the second notification message is obtained by the notification end based on the first notification message.
[0111] In operation S750, the second notification message is uploaded to the blockchain.
[0112] According to an embodiment of the present disclosure, saving the second notification message on the blockchain when the notification fails can avoid the loss of the second notification message. Additionally, when the specific transaction information is in a failed state and there is an associated second notification message on the blockchain, it can be placed in a message queue and asynchronously pushed to the notification end at regular intervals, causing the notification end to re-push it to the target business system.
[0113] Figure 8 Schematically shows a flowchart of an information pushing method applied to a notification end according to an embodiment of the present disclosure.
[0114] As Figure 8 shown, the information pushing method applied to the notification end in this embodiment includes operation S810 to operation S830.
[0115] In operation S810, the first notification message sent by the first node of the blockchain system is received, where the first notification message is obtained by the first node based on a listening event in the blockchain system, and the listening event includes an event generated when the blockchain system invokes at least one target smart contract.
[0116] In operation S820, the second notification message is obtained based on the first notification message.
[0117] In operation S830, the second notification message is pushed to M business systems, where M is an integer greater than or equal to 1.
[0118] According to an embodiment of the present disclosure, the second notification message obtained by the notification end may include information such as user account, business name, amount, bank, etc. If the notification end obtains that it involves Bank B from the second notification message. Then the transaction information of this payment is sent to the off-chain business system of Bank B in the business server 1501 to execute this payment transaction.
[0119] According to an embodiment of the present disclosure, first notification information is obtained through an independent notification terminal, and then second notification information is obtained based on the first notification information, and the second notification information is pushed to M business systems. Thereby, the blockchain system and the off-chain business systems are decoupled, the time and system resources for each off-chain business system to process block data are saved, and the efficiency of each off-chain business system to obtain information is improved. In addition, technicians of the off-chain business systems can complete the docking with the blockchain system without understanding blockchain technology, reducing the docking difficulty.
[0120] Figure 9 Schematically shows a flowchart of obtaining second notification information based on the first notification information in operation S820 according to an embodiment of the present disclosure.
[0121] As Figure 9 shown, obtaining the second notification information based on the first notification information in operation S820 of this embodiment includes operations S910 to S930.
[0122] In operation S910, the first notification information is parsed to obtain positioning data of specific transaction information, where the positioning data includes the block position of the specific transaction information in the blockchain.
[0123] According to an embodiment of the present disclosure, the first notification information sent by the first node may include, for example, the transaction ID, transaction type, transaction status, and positioning data of the specific transaction information. Among them, the positioning data may be block position information such as the block height or block hash value of the block where the specific transaction information is located.
[0124] In some other embodiments of the present disclosure, the first node may directly send the monitoring event to the notification terminal, and the notification terminal parses the monitoring event and obtains information such as user account, transaction amount, business name, bank, etc. as the second notification information, and finally pushes it to the target business system.
[0125] In operation S920, the specific transaction information is obtained from the target block according to the positioning data, where the blockchain includes the target block, and the position of the target block is the block position.
[0126] According to an embodiment of the present disclosure, for example, the notification terminal finds the corresponding target block from the blockchain based on the block height and parses to obtain the block data. Then, the specific transaction information is obtained from multiple transactions in the block data according to the transaction ID.
[0127] In operation S930, the second notification information is obtained based on the specific transaction information.
[0128] According to an embodiment of the present disclosure, after receiving the first notification information, the notification terminal timely obtains the second notification information. Compared with the notification terminal regularly querying each block in the blockchain to obtain the notification content, it can improve the flexibility of notifications and ensure the timeliness of obtaining the notification content.
[0129] Figure 10 Schematically shows a flowchart of obtaining the second notification information based on specific transaction information in operation S930 according to an embodiment of the present disclosure.
[0130] As Figure 10 shown, obtaining the second notification information based on specific transaction information in operation S930 includes operations S1010 to S1020.
[0131] In operation S1010, obtain at least one target business system involved from the specific transaction information.
[0132] In operation S1020, obtain the second notification information based on the push format agreed with at least one target business system.
[0133] According to an embodiment of the present disclosure, for example, in the payment transaction submitted by the user, it involves using an account of Bank B for payment. After determining the off-chain business system of Bank B (i.e., the target business system), based on the format previously agreed between Bank B and the notification terminal, such as the data format and content format. Among them, the data format can be, for example, a format adapted to the programming language used by the off-chain business system of Bank B. The content format can be the information required for the off-chain business system of Bank B to execute this payment transaction, etc.
[0134] According to an embodiment of the present disclosure, by obtaining the second notification information through the push format agreed with each business system and pushing it, the diverse push requirements of each business system can be met. And it reduces the docking difficulty between each business system and the notification terminal.
[0135] Figure 11 Schematically shows a flowchart of the notification terminal receiving response information according to an embodiment of the present disclosure.
[0136] As Figure 11 shown, after pushing the second notification information to M business systems in operation S930, the notification terminal of this embodiment receiving the response information includes operations S1110 to S1150.
[0137] In operation S1110, receive the response information returned by each target business system.
[0138] According to an embodiment of the present disclosure, for example, a user's transaction may involve Enterprise A, Bank B, and Bank C. After sending notifications to the respective business systems of Enterprise A, Bank B, and Bank C (i.e., the target business systems), response information returned by Enterprise A, Bank B, and Bank C is received.
[0139] In operation S1120, the response information and / or the second notification information is sent to the first node, so that the first node updates the notification status of the specific transaction information in the blockchain based on the response information.
[0140] According to an embodiment of the present disclosure, if the response information indicates that the notification is successful, only the response information is sent, so that the first node directly updates the notification status of the specific transaction information on the blockchain. If the response information indicates that the notification fails, the second notification information may be sent while sending the response information. In some embodiments of the present disclosure, if the response information indicates that the notification fails, only the second notification information may be sent, so that the first node uploads the second notification information to the chain and automatically updates the notification status of the specific transaction information on the blockchain to the failure status.
[0141] In operation S1130, it is determined whether all the target business systems are successfully notified. If so, the process ends. If not, operation S1140 is executed. Among them, when there is one or more response information indicating that the notification fails, operations S1130 to S1150 are repeatedly executed until all notifications are successful:
[0142] In operation S1140, the second notification information and the address information of the target business system where the notification fails are recorded in the first file.
[0143] In operation S1150, based on the second notification information and the address information, the notification is resent at regular intervals.
[0144] If Bank B and Bank C return error information (i.e., the response information indicates that the notification fails), then the name of the smart contract involved in this notification, the ID of the transaction, the target information, the Bank B URL, the Bank C URL, etc. are all recorded (i.e., the first record) in the record_error file (i.e., the first file) and resent at regular intervals. In some embodiments, if the resending is successful, the relevant notification content in the record_error file is deleted. If the URL returns successful information (i.e., the response information indicates that the notification is successful), then the name of the smart contract involved in this notification, the Id of the transaction, the target information, the Bank B URL, and the Bank C URL are all recorded in the record_success file for the convenience of operation and maintenance personnel for operation and maintenance.
[0145] According to an embodiment of the present disclosure, logs (such as record_error files and record_success files) can be incrementally saved by daily date, and the sample is '202x-xx-xx_sys.log'. At the same time, to prevent the log data from being too large, historical logs are saved according to the log saving policy. Among them, the log saving policy can be, for example, deleting the logs before a specified date.
[0146] Although the above operations of the method are described in a specific order, the embodiments of the present disclosure are not limited thereto, and the above operations can be executed in other orders as needed. For example, step S1130 can be executed after step S1130, or can be executed simultaneously.
[0147] According to an embodiment of the present disclosure, before receiving the first notification information sent by the first node of the blockchain system, it further includes: listening to the first node based on the remote procedure call method. Among them, in the case of a listening failure of the first node, the method further includes: re-listening to the first node based on the reconnection method. For example, write the IP and port information of the listened node 111 into the configuration file so as to find the listened node 111. After the node restarts after a downtime, use the GRPC (Google Remote Procedure Call, a remote call method based on Google) fault tolerance mechanism (i.e., the reconnection method) to immediately re-listen to the node.
[0148] After the listened blockchain node goes down, the GRPC connection fails and the node cannot be normally listened to. After the node goes down and then successfully reorganizes the network, based on the GRPC reconnection, by calling the http: / / IP:8001 / relink method, it is ensured that the event of the node that goes down and then restarts can be timely listened and discovered, and there is no need to restart the notification end.
[0149] Deploy the notification end on any server that can access the blockchain, and then the listening events in the blockchain system can be listened to in real time and relevant information can be sent to the off-chain business system.
[0150] Figure 12 Schematically shows a flowchart of pushing the second notification information in operation S830 according to an embodiment of the present disclosure.
[0151] As Figure 12 shown, pushing the second notification information to M business systems in operation S830 of this embodiment includes operations S1210 to S1270.
[0152] In operation S1210, obtain the address information of the target business system from the configuration file according to the second notification information.
[0153] According to an embodiment of the present disclosure, before operation S1210, a configuration file can also be set. For example, access information of the blockchain can be set in the configuration file to obtain block data through the access information. Among them, referring to Figure 1 , the access information may include the IP address and port information of node 111.
[0154] According to an embodiment of the present disclosure, address information of each of the M business systems is set in the configuration file. Among them, the address information may include the URL (Uniform Resource Locator) address of each business system.
[0155] According to an embodiment of the present disclosure, preset conditions are set in the configuration file, including: setting the name of at least one target smart contract, and the data structure of the listening identifier generated by at least one target smart contract.
[0156] Among them, the IP address port information, smart contract name, and URL of the business system exist in the configuration file in an array form, enabling the notification end to serve multiple business systems simultaneously. Users can set the content in the configuration file through terminal devices 121, 122, and 123.
[0157] According to an embodiment of the present disclosure, when the monitored node IP and port, smart contract name, and the URL of the off-chain business system change, the configuration file can be modified. Specifically, after modifying the configuration file, the interface http: / / IP:8xxx / reload (only an example) for configuration update exposed by the notification end can be called to dynamically update the configuration information without restarting the notification end.
[0158] In operation S1220, a notification is sent based on the second notification information and the address information. Among them, the second notification information may correspond to a certain transaction information in the i-th block.
[0159] According to an embodiment of the present disclosure, for example, the second notification information includes the user's payment information, including the B bank account used for payment. At this time, the notification end can obtain the address information of the business system of Bank B from the configuration file, such as the URL link.
[0160] In operation S1230, it is determined whether the notification is successful. If so, operation S1250 is executed. If not, operation S1240 is executed.
[0161] In operation S1240, the notification content is written into the first file to form a failure record. Then, operation S1220 is executed regularly. At this time, notifications are sent according to the notification information and address information in the failure record. Among them, the failure record may include the name of the smart contract involved in this notification, the ID of the transaction, the second notification information, the address information of the target business system where the notification fails, etc.
[0162] According to the embodiments of the present disclosure, the notification content in the payload can be sent to the relevant off-chain business system URL, and the off-chain business system returns a response in the format of a return message. If the URL returns an error message, the event name, the name of the smart contract, the ID of the transaction, and the notification content are persisted in the blockchain and resent regularly. If the resending is successful, the relevant notification status in the blockchain is changed. If the URL returns a success message, the event name, the name of the smart contract, the ID of the transaction, and the payload are recorded in the record file for the convenience of operation and maintenance personnel.
[0163] In operation S1250, a success log is recorded and the notification status is updated. During the regular resending process, if the target business system is notified successfully, the notification status of the specific transaction information on the blockchain is updated to the success status.
[0164] In operation S1260, it is marked that the second notification information has been successfully sent.
[0165] In operation S1270, it is judged whether the second notification information has been notified. If so, this loop ends. If not, operation S1210 is executed. In some embodiments, multiple second notification information can be obtained based on the first notification information. Therefore, after sending one second notification information, it can be judged whether each second notification information has been notified to M business systems.
[0166] Although the above operations of the method are described in a specific order, the embodiments of the present disclosure are not limited thereto, and the above operations can be executed in other orders as needed. For example, the loop operation of regular resending after forming a failure record in operation S1240 for the current target information can be executed asynchronously with the operation of continuing to notify the next second notification information after operation S1270 without affecting each other.
[0167] Based on the above blockchain-based information push method that can be used for the first node and the notification end, the present disclosure also provides a blockchain-based information push device for the first node and a blockchain-based information push device for the notification end. The following will be combined with Figure 13 and Figure 14 to describe the device in detail.
[0168] Figure 13A structural block diagram of a blockchain-based information push device 1300 applied to a first node according to an embodiment of the present disclosure is schematically shown.
[0169] As Figure 13 shown, the information push device 1300 of this embodiment includes a first acquisition module 1310, a second acquisition module 1320, and a first notification module 1330.
[0170] The first acquisition module 1310 can, for example, execute operation S210 to obtain monitoring events in the blockchain system, where the monitoring events include events generated by the blockchain system invoking at least one target smart contract.
[0171] According to an embodiment of the present disclosure, the first acquisition module 1310 can, for example, execute operations S310 to S320, operations S410 to S420, which will not be elaborated here.
[0172] The second acquisition module 1320 can, for example, execute operation S220 to obtain first notification information based on the monitoring events when the monitoring events are obtained.
[0173] According to an embodiment of the present disclosure, the second acquisition module 1320 can, for example, execute operations S510 to S520, which will not be elaborated here.
[0174] The first notification module 1330 can, for example, execute operation S230 to notify M service systems based on the first notification information, where M is an integer greater than or equal to 1.
[0175] According to an embodiment of the present disclosure, the first notification module 1330 can, for example, execute operation S610, operations S710 to S720, which will not be elaborated here.
[0176] Figure 14 A structural block diagram of a blockchain-based information push device 1400 applied to a notification end according to an embodiment of the present disclosure is schematically shown.
[0177] As Figure 14 shown, the information push device 1400 of this embodiment includes a data reception module 1410, a third acquisition module 1420, and a second notification module 1430.
[0178] The data reception module 1410 can, for example, execute operation S810 to receive the first notification information sent by the first node of the blockchain system, where the first notification information is obtained by the first node based on the monitoring events in the blockchain system, and the monitoring events include events generated by the blockchain system invoking at least one target smart contract.
[0179] The third acquisition module 1420 may, for example, perform operation S820 to obtain second notification information based on the first notification information.
[0180] According to an embodiment of the present disclosure, the third acquisition module 1420 may, for example, perform operations S910 to S930, and operations S1010 to S1020, which will not be elaborated herein.
[0181] The second notification module 1430 may, for example, perform operation S830 to push the second notification information to M service systems, where M is an integer greater than or equal to 1.
[0182] According to an embodiment of the present disclosure, the third acquisition module 1420 may, for example, perform operations S1110 to S1150, and operations S1210 to S1270, which will not be elaborated herein.
[0183] According to an embodiment of the present disclosure, any number of modules in the information push device 1300 or the information push device 1400 may be combined and implemented in one module, or any one of the modules may be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules may be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one module in the information push device 1300 or the information push device 1400 may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on board, a system in package, an application specific integrated circuit (ASIC), or may be implemented by any other reasonable means such as integrating or packaging the circuit, etc., in hardware or firmware, or implemented in any one of the three implementation manners of software, hardware, and firmware, or in an appropriate combination of any several of them. Alternatively, at least one module in the information push device 1300 or the information push device 1400 may be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding functions may be executed.
[0184] Figure 15 Schematically shows a block diagram of an electronic device suitable for implementing the...... method according to an embodiment of the present disclosure.
[0185] As Figure 15As shown, the electronic device 1500 according to an embodiment of the present disclosure includes a processor 1501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1502 or a program loaded from a storage section 1508 into a random access memory (RAM) 1503. The processor 1501 may include, for example, a general-purpose microprocessor (e.g., CPU), an instruction set processor, and / or a related chipset, and / or a dedicated microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1501 may also include on-board memory for caching purposes. The processor 1501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0186] In the RAM 1503, various programs and data required for the operation of the electronic device 1500 are stored. The processor 1501, the ROM 1502, and the RAM 1503 are connected to each other via a bus 1504. The processor 1501 performs various operations of the method flow according to an embodiment of the present disclosure by executing the programs in the ROM 1502 and / or the RAM 1503. It should be noted that the program may also be stored in one or more memories other than the ROM 1502 and the RAM 1503. The processor 1501 may also perform various operations of the method flow according to an embodiment of the present disclosure by executing the programs stored in one or more memories.
[0187] According to an embodiment of the present disclosure, the electronic device 1500 may further include an input / output (I / O) interface 1505, and the input / output (I / O) interface 1505 is also connected to the bus 1504. The electronic device 1500 may further include one or more of the following components connected to the I / O interface 1505: an input section 1506 including a keyboard, a mouse, etc.; an output section 1507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1508 including a hard disk, etc.; and a communication section 1509 including a network interface card such as a LAN card, a modem, etc. The communication section 1509 performs communication processing via a network such as the Internet. A driver 1510 is also connected to the I / O interface 1505 as needed. A removable medium 1511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the driver 1510 as needed so that a computer program read from it can be installed into the storage section 1508 as needed.
[0188] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the foregoing embodiments; or may exist independently without being assembled into the device / apparatus / system. The foregoing computer-readable storage medium carries one or more programs, and when the one or more programs are executed, the methods according to the embodiments of the present disclosure are implemented.
[0189] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing. In the present disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the foregoing ROM 1502 and / or RAM 1503 and / or one or more memories other than ROM 1502 and RAM 1503.
[0190] An embodiment of the present disclosure further includes a computer program product, which includes a computer program, and the computer program includes program codes for executing the methods shown in the flowcharts. When the computer program product runs in a computer system, the program codes are used to cause the computer system to implement the methods according to the embodiments of the present disclosure.
[0191] When the computer program is executed by the processor 1501, the above functions defined in the system / apparatus of the embodiments of the present disclosure are executed. According to an embodiment of the present disclosure, the foregoing systems, apparatuses, modules, units, etc. may be implemented by computer program modules.
[0192] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices and magnetic storage devices. In another embodiment, the computer program may also be transmitted and distributed in the form of a signal on a network medium, and downloaded and installed through the communication part 1509, and / or installed from the removable medium 1511. The program codes included in the computer program may be transmitted by any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
[0193] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 1509, and / or installed from the removable medium 1511. When the computer program is executed by the processor 1501, the above-described functions defined in the system of the embodiments of the present disclosure are performed. According to an embodiment of the present disclosure, the above-described systems, devices, apparatuses, modules, units, etc. can be implemented by computer program modules.
[0194] According to an embodiment of the present disclosure, the program code for executing the computer program provided in the embodiments of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, such as Java, C++, Python, the "C" language, or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., by connecting through the Internet using an Internet service provider).
[0195] The above describes the embodiments of the present disclosure. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in each embodiment cannot be used advantageously in combination. The scope of the present disclosure is defined by the appended claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art can make various substitutions and modifications, and these substitutions and modifications should fall within the scope of the present disclosure.
Claims
1. An information push method based on blockchain, which is applied to the first node of a blockchain system. An event listener is set in the first node. The method includes: Based on preset conditions in a configuration file, using the event listener to obtain monitoring events generated by invoking at least one target smart contract in the blockchain system. Among them, the preset conditions include the names of the at least one target smart contract, and the data structure of the monitoring identifier generated by the at least one target smart contract; When the monitoring event is obtained, determining corresponding specific transaction information based on the monitoring event, and obtaining first notification information based on the specific transaction information. Among them, the specific transaction information includes different transactions processed by different target smart contracts, and the different transactions correspond to different monitoring events; Notifying M business systems based on the first notification information, where M is an integer greater than or equal to 1. Among them, the specific transaction information for notification and the corresponding monitoring events are set during the programming of the smart contract.
2. The method according to claim 1, wherein The notifying M business systems includes: Pushing the first notification information to a notification end so that the notification end notifies the M business systems based on the first notification information.
3. The method according to claim 2, wherein, It further includes: Receiving response information sent by the notification end, where the response information includes information returned by at least one target business system among the M business systems after receiving the notification; Updating the notification status of the specific transaction information in the blockchain based on the response information, where the specific transaction information is associated with the monitoring event.
4. The method according to claim 3, wherein, It includes: When there is one or more response information indicating notification failure, Receiving second notification information sent by the notification end, where the second notification information is obtained by the notification end based on the first notification information; Uploading the second notification information to the blockchain.
5. The method according to claim 1, wherein The obtaining of the monitoring events generated by invoking at least one target smart contract in the blockchain system includes: Real-time obtaining of the latest block uploaded to the blockchain; Querying the monitoring identifier of the monitoring event from the latest block.
6. The method according to claim 1, wherein, The blockchain system invoking at least one target smart contract includes: Obtaining specific transaction information submitted by a user; Invoking the at least one target smart contract to process the specific transaction information.
7. An information push method based on blockchain, which is applied to a notification end, and includes: Receiving first notification information sent by the first node of the blockchain system, where the first node is configured to execute the method according to any one of claims 1 to 6. The first notification information is obtained by the first node based on the monitoring events in the blockchain system, and the monitoring events include events generated by the blockchain system invoking at least one target smart contract; Obtaining second notification information based on the first notification information; Pushing the second notification information to M business systems, where M is an integer greater than or equal to 1.
8. The method according to claim 7, wherein, The obtaining of the second notification information based on the first notification information includes: Parse the first notification information to obtain positioning data of specific transaction information, where the positioning data includes the block position of the specific transaction information in the blockchain; Obtain the specific transaction information from the target block according to the positioning data, where the blockchain includes the target block, and the position of the target block is the block position; Obtain the second notification information based on the specific transaction information.
9. The method according to claim 8, wherein The M business systems include at least one target business system, and the obtaining the second notification information based on the specific transaction information includes: Obtain the at least one target business system involved from the specific transaction information; Obtain the second notification information based on the push format agreed with the at least one target business system.
10. The method according to claim 8, wherein, The M business systems include at least one target business system. After pushing the second notification information to the M business systems, the method further includes: Receive response information returned by each target business system; Send the response information and / or the second notification information to the first node, so that the first node updates the notification status of the specific transaction information in the blockchain based on the response information.
11. The method according to claim 10, wherein, After receiving the response information returned by each target business system, it further includes: If one or more of the response information indicates notification failure, loop to perform the following operations until all notifications are successful: record the second notification information and the address information of the target business system with notification failure in a first file; Based on the second notification information and the address information, resend the notification regularly.
12. An information push device based on blockchain, applied to the first node of a blockchain system, where an event listener is set in the first node, and the device includes: A first acquisition module, configured to obtain a listening event in the blockchain system by using the event listener based on preset conditions in a configuration file, where the preset conditions include the name of at least one target smart contract and the data structure of a listening identifier generated by the at least one target smart contract; A second acquisition module, configured to, when the listening event is obtained, determine corresponding specific transaction information based on the listening event, and obtain first notification information based on the specific transaction information, where the specific transaction information includes different transactions processed by different target smart contracts, and the different transactions correspond to different listening events; A first notification module, configured to notify M business systems based on the first notification information, where M is an integer greater than or equal to 1, and the specific transaction information to be notified and the corresponding listening events are set when programming the smart contract.
13. An information push device based on blockchain, applied to a notification end, includes: A data receiving module, configured to receive first notification information sent by a first node of a blockchain system, where the first node is configured to execute the method according to any one of claims 1 to 6, and the first notification information is obtained by the first node based on a listening event in the blockchain system, and the listening event includes an event generated by the blockchain system invoking at least one target smart contract; A third obtaining module, configured to obtain second notification information based on the first notification information; A second notification module, configured to push the second notification information to M service systems, where M is an integer greater than or equal to 1.
14. An electronic device, comprising: One or more processors; A storage device, configured to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors are caused to execute the method according to any one of claims 1 to 11.
15. A computer-readable storage medium, having stored thereon executable instructions that, when executed by a processor, cause the processor to execute the method according to any one of claims 1 to 11.
16. A computer program product, comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Message pushing method, device, equipment and readable storage medium
CN109587265A
Transaction monitoring method, device and equipment based on block chain and storage medium
CN109670950A