WO2020216077A1 - Blockchain event deduplication method and apparatus, and computer device and storage medium - Google Patents

Blockchain event deduplication method and apparatus, and computer device and storage medium Download PDF

Info

Publication number
WO2020216077A1
WO2020216077A1 PCT/CN2020/084282 CN2020084282W WO2020216077A1 WO 2020216077 A1 WO2020216077 A1 WO 2020216077A1 CN 2020084282 W CN2020084282 W CN 2020084282W WO 2020216077 A1 WO2020216077 A1 WO 2020216077A1
Authority
WO
WIPO (PCT)
Prior art keywords
event
contract
identifier
deduplication
blockchain system
Prior art date
Application number
PCT/CN2020/084282
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 WO2020216077A1 publication Critical patent/WO2020216077A1/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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding

Definitions

  • the embodiments of the present invention relate to the field of financial technology (Fintech), and in particular to a method, device, computer equipment, and storage medium for deduplication of a blockchain (BlockChain) event.
  • Fetech financial technology
  • BlockChain blockchain
  • a blockchain is a chain composed of a series of blocks. Each block records the data of the block and the hash value of the previous block. In this way, all blocks form a chain one after another.
  • the cryptographic technology and decentralized ideas on which the blockchain is based make the historical information on the chain unable to be tampered with.
  • the producer writes the event to be published into the blockchain system, and the consumer reads the event to be obtained from the blockchain system.
  • the producer publishes an event to the blockchain system, if it does not receive a response message from the blockchain system within the preset time period, it will republish the same event to the blockchain system, but the blockchain system can process it at the same time
  • the number of events is limited. If producers publish the same event multiple times to the blockchain system, it will cause unnecessary pressure on the blockchain system.
  • the embodiments of the present invention provide a method, device, computer equipment, and storage medium for deduplication of blockchain events, so as to prevent the publishing server from publishing the same event multiple times to the blockchain system, thereby reducing the pressure on the blockchain system.
  • a method for deduplication of blockchain events includes:
  • the block chain system receives the transaction request sent by the publishing server; the transaction request is used to request the publication of the event; the transaction request includes the publication identification of the event to be published;
  • the blockchain system calls a deduplication contract to determine whether an event identifier corresponding to the release identifier is stored in the blockchain system; the event identifier is used to uniquely identify the published event;
  • the blockchain system determines that the event identifier corresponding to the release identifier is stored in the blockchain system, it sends the event identifier corresponding to the release identifier to the publishing server.
  • the blockchain system After the blockchain system receives the transaction request sent by the publishing server, it does not directly generate a transaction log recording the event to be published, but first calls the deduplication contract to determine whether there is an event to be published in the blockchain system If there is an event ID corresponding to the release ID, it can be determined that the event to be released has been successfully released to the blockchain system without re-publishing, that is, to avoid publishing the same event to the blockchain system by the publishing server multiple times, reducing The blockchain system processes the number of events at the same time, reducing the workload of the blockchain system, and avoiding consumers from subscribing to the same event, improving user experience.
  • Optional also includes:
  • the blockchain system determines that the event identifier corresponding to the release identifier is not stored in the blockchain system, it calls the theme contract of the theme to which the event to be published belongs; the theme contract is used in the transaction log Record the event to be published and the event identifier of the event to be published;
  • the blockchain system sends the event identifier of the event to be published to the publishing server, and stores the event identifier of the event to be published and the release identifier in the storage space indicated by the deduplication contract. .
  • the blockchain system After the blockchain system receives the transaction request sent by the publishing server, if it is determined that the event identifier corresponding to the publishing identifier is not stored, it is determined that the event to be published has not been successfully published to the blockchain system and needs to be called The subject contract of the subject to which the event to be published belongs is released, so as to ensure that the event to be published in the transaction request sent by the publishing server is successfully published to the blockchain system.
  • the deduplication contract is set with a maximum storage duration
  • the method also includes:
  • the blockchain system deletes the correspondence relationship between the release identifier and the event identifier that reaches the maximum storage duration from the storage space indicated by the deduplication contract.
  • the maximum storage duration is set in the deduplication contract, Regularly clear the corresponding relationship in the deduplication contract to avoid the problem of insufficient storage space in the deduplication contract, resulting in limited functions.
  • setting the maximum storage duration can reduce the workload of the deduplication contract in finding the event identifier corresponding to the release identifier, and further improve the work efficiency of the blockchain system.
  • the blockchain system includes multiple storage spaces
  • the block chain system correspondingly storing the event identifier of the event to be released and the release identifier in the storage space indicated by the deduplication contract includes:
  • the blockchain system determines the storage space indicated by the deduplication contract from the plurality of storage spaces according to the release identifier of the event to be published; the event identifier of the event to be released and the release identifier Correspondingly stored in the storage space of the deduplication contract instruction.
  • multiple storage spaces are stored in the blockchain system, and different to-be-published events are set to be mapped to corresponding storage spaces according to the events to be published, so as to realize the corresponding relationship between the release ID and the event ID in accordance with the rules Classified into multiple storage spaces, more storage of the corresponding relationship between the release ID and the event ID.
  • the blockchain system calling the deduplication contract includes:
  • the blockchain system calls the theme contract of the theme to which the event to be published belongs, and calls the deduplication contract through the theme contract of the theme to which the event to be published belongs.
  • the blockchain system after receiving the transaction request, the blockchain system first calls the subject contract of the subject to which the event to be published belongs, and then calls the deduplication contract from the subject contract to improve the orderliness of the blockchain system in actual work Sex.
  • an embodiment of the present invention also provides a method for deduplication of blockchain events, including:
  • the publishing server sends a deployment request to the blockchain system; the deployment request is used to deploy a deduplication contract in the blockchain system; the deduplication contract is used to determine whether the blockchain system stores the release identifier of the event to be published Corresponding event identifier; the event identifier is used to uniquely identify the published event;
  • the publishing server receives a deployment response, where the deployment response is used to indicate that the deduplication contract is successfully deployed.
  • the publishing server pre-deploys a deduplication contract in the blockchain system for when sending transaction requests to the blockchain system
  • the blockchain system can filter out the same events and feed back to the publishing server at the same time
  • the event identifier corresponding to the publishing identifier prevents the publishing server from issuing multiple transaction requests for the same event to the blockchain system, and improves the working efficiency of the publishing server.
  • an embodiment of the present invention also provides a blockchain event deduplication device, including:
  • the transceiver unit is configured to receive a transaction request sent by the publishing server; the transaction request is used to request the publication of the event; the transaction request includes the publication identification of the event to be published;
  • the processing unit is used to call the deduplication contract to determine whether the event identifier corresponding to the release identifier is stored in the blockchain system; the event identifier is used to uniquely identify the published event;
  • the processing unit is further configured to, if it is determined that the event identifier corresponding to the release identifier is stored in the blockchain system, control the transceiver unit to send the event identifier corresponding to the release identifier to the publishing server.
  • processing unit is further configured to:
  • Control the transceiver unit to send the event identifier of the event to be published to the publishing server, and correspondingly store the event identifier of the event to be published and the release identifier in the storage space indicated by the deduplication contract.
  • the deduplication contract is set with a maximum storage duration
  • the processing unit is also used for:
  • the correspondence relationship between the release identifier and the event identifier that reaches the maximum storage duration is deleted from the storage space indicated by the deduplication contract.
  • the blockchain system includes multiple storage spaces
  • the processing unit is specifically used for:
  • the storage space indicated by the deduplication contract is determined from the multiple storage spaces; the event identifier of the event to be released and the release identifier are correspondingly stored in the destination Re-contract indicates in the storage space.
  • processing unit is specifically configured to:
  • an embodiment of the present invention also provides a blockchain event deduplication device, including:
  • the sending unit is used to send a deployment request to the blockchain system; the deployment request is used to deploy a deduplication contract in the blockchain system; the deduplication contract is used to determine whether there are events to be published in the blockchain system
  • the event identifier corresponding to the release identifier of, the event identifier is used to uniquely identify the published event;
  • the receiving unit is configured to receive a deployment response, where the deployment response is used to indicate that the deduplication contract is successfully deployed.
  • an embodiment of the present invention also provides a computer device, including:
  • Memory used to store program instructions
  • the processor is configured to call the program instructions stored in the memory, and execute the above blockchain event de-duplication method according to the obtained program.
  • embodiments of the present invention also provide a computer-readable non-volatile storage medium, including computer-readable instructions, which when the computer reads and executes the computer-readable instructions, cause the computer to execute the aforementioned blockchain Event deduplication method.
  • an embodiment of the present invention also provides a computer program product, the computer program product includes a calculation program stored on a non-transitory computer-readable storage medium, the computer program includes program instructions, when the program When the instruction is executed by the computer, the computer is caused to execute the above-mentioned blockchain event deduplication method.
  • FIG. 1 is a schematic diagram of a system architecture provided by an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a method for deduplication of blockchain events according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a device for deduplication of blockchain events provided by an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a device for deduplication of blockchain events provided by an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.
  • FIG. 1 exemplarily shows the system architecture applicable to the method for deduplication of blockchain events provided by the embodiment of the present invention.
  • the system architecture may include a producer 100, a publishing server 200, a blockchain system 300, a subscriber server 400, and a consumer ⁇ 500.
  • the producer 100 is used to generate events to be published
  • the publishing server 200 is used to write the events to be published into the blockchain system 300
  • the consumer 500 is used to subscribe to events from the blockchain system 300 through the subscription server 400.
  • the producer 100 When the producer 100 needs to publish an event, it sends the event to be published to the publishing server 200, the publishing server 200 generates a transaction request according to the event to be published, the publishing server 200 sends the transaction request to the blockchain system 300, and the blockchain system 300 according to the transaction Request to execute the contract and record the event to be released, that is, the event release of the producer 100 is completed.
  • the consumer 500 When the consumer 500 needs to acquire an event, it sends an acquisition request to the subscription server 400.
  • the subscription server 400 determines the event corresponding to the acquisition request from the blockchain system 300 according to the received acquisition request, and feeds it back to the consumer 500 to complete the consumer 500 event subscriptions.
  • the publishing server 200 and the subscribing server 400 in the system architecture can be one server physically, which completes publishing and subscribing functions, or two separate servers, which complete publishing and subscribing functions respectively, which will not be done here. limit.
  • the blockchain system 300 executes the contract according to the transaction request and records the event to be released. After the event is released, it is stored in the blockchain system 300. Since the blockchain system 300 is a chain structure, it is not easy to be tampered with and deleted. The feature of, guarantees the security of the release event stored in the blockchain system 300.
  • the publishing server 200 After the publishing server 200 sends a transaction request to the blockchain system 300, if the publishing server 200 can obtain a response message for publishing events from the blockchain system 300, and the response message records the event identifier of the publishing event, the publishing server 200 determines that the event to be published has been successfully published to the blockchain system 300, otherwise, the publishing server 200 will determine that the event to be published has not been successfully published to the blockchain system 300 and needs to publish the to-be published event to the blockchain system 300 again Events, combined with the description, the scenarios involved in the embodiments of the present invention are:
  • Scenario 1 The publishing server sends a transaction request to the blockchain system.
  • the blockchain system successfully generates a transaction log and feeds back a response message.
  • the response message contains the event identifier of the publishing event.
  • the publishing server receives the response message and determines that the event is successfully published. .
  • Scenario 2 The publishing server sends a transaction request to the blockchain system.
  • the blockchain system successfully generates a transaction log, but the publishing server does not receive a response message from the blockchain system, or there is no event publishing event in the response message. ID, the publishing server considers the event to be published unsuccessfully and needs to be republished, stores the same event in the transaction request and sends it to the blockchain system.
  • the blockchain system determines that the event identifier for the published event has been stored in the blockchain system. Then, the event identifier of the publishing event is fed back to the publishing server to inform the publishing server that the event has been successfully published.
  • Scenario 3 The publishing server sends a transaction request to the blockchain system, the blockchain system fails to generate a transaction log, the publishing server does not receive the response message fed back by the blockchain system, or there is no event publishing event in the response message fed back.
  • the publishing server considers that the event is not successfully published and needs to be republished. The same event is stored in the transaction request and sent to the blockchain system.
  • the blockchain system determines that the event identifier of the published event is not stored in the blockchain system.
  • the subject contract of the subject to which the event to be published belongs is called, a transaction log is generated, and a response message recording the event identifier of the published event is fed back to the publishing server, thereby notifying the publishing server that the event has been successfully published.
  • Figure 2 exemplarily shows the flow of a blockchain event deduplication method provided by an embodiment of the present invention.
  • the flow can be executed by a blockchain event deduplication device, which can be located in the blockchain.
  • a blockchain event deduplication device which can be located in the blockchain.
  • the process involves the execution subject including the publishing server and the blockchain system.
  • the specific process is as follows.
  • Step 201 The publishing server sends a transaction request to the blockchain system.
  • the publishing server receives the publishing request sent by the producer, generates a transaction request according to the publishing request, and sends it to the blockchain system.
  • the transaction request is used to request the publishing of the event, and the transaction request includes the publishing identification of the event to be published.
  • the release identifier of the event to be released can include the producer IP (Internet Protocol, interconnection protocol between networks) address, thread ID (Identification), timestamp, time increment value and other information of the event to be released.
  • the publication identifier of the event to be published may be the UUID (Universally Unique Identifier) of the event to be published.
  • the release identifier of the event to be published can be generated by the producer or the publishing server.
  • the publishing server When the publishing server generates the release identifier of the event to be published, it will perform all received events to be published according to certain rules. ID to ensure that the release ID of the event to be released is used to uniquely identify the event to be released.
  • Step 202 the blockchain system calls the deduplication contract.
  • a deduplication contract can be deployed in the blockchain system.
  • the deduplication contract is used to prevent the publishing server from publishing the same pending event to the blockchain system.
  • the deduplication contract is used to determine whether there is a pending storage in the blockchain system Publish the event identifier corresponding to the issue identifier of the event to prevent the publishing server from publishing the same pending event to the blockchain system.
  • the publishing server may pre-deploy the deduplication contract. Specifically, the publishing server sends a deployment request to the blockchain system. The deployment request is used to deploy the deduplication contract in the blockchain system. After the system receives the deployment request, it deploys the deduplication contract in the blockchain system according to the deployment request. After the deduplication contract is deployed, the blockchain system sends a deployment response to the publishing server to notify the publishing server that the deployment is successful.
  • Step 203 The blockchain system determines whether an event identifier is stored in the blockchain system.
  • the blockchain system will generate a transaction log that records the event to be released.
  • the generation of the transaction log means that the event to be released becomes a published event, and the transaction log is The event identifier is recorded, and the event identifier is used to uniquely identify the published event and also has a corresponding relationship with the release identifier of the event to be published.
  • the corresponding relationship between the release identifier of the event and the event identifier can be stored in the storage space indicated by the deduplication contract, and the blockchain system can directly call the deduplication contract to determine the storage space indicated by the deduplication contract Whether to store the event ID corresponding to the release ID of the event to be released. It is also possible to call the deduplication contract through the theme contract of the theme to which the event to be published belongs, that is, the blockchain system calls the theme contract of the theme to which the event to be published belongs, and calls the deduplication contract through the theme contract of the theme to which the event belongs.
  • the maximum storage duration can be set in the deduplication contract.
  • the corresponding relationship between the release identifier of the event in the contract and the event identifier exceeds the maximum storage time, then the corresponding relationship between the two is deleted.
  • step 204 the blockchain system sends the event identifier corresponding to the issuing identifier to the issuing server.
  • the event identifier corresponding to the release identifier is stored in the blockchain system, it is determined that the release of the event to be published is completed, and the event identifier corresponding to the determined release identifier is sent to the publishing server to inform the publishing server that the event to be published has been completed.
  • the blockchain system determines that the event identifier is not stored in the blockchain system, and then determines that the event to be released has not been released, and the blockchain system needs to execute a contract to release the event to be released.
  • the blockchain system calls the subject contract of the subject of the event to be published to generate a transaction log that records the event to be published and the event identifier of the event to be published, and the blockchain system sends the event identifier of the event to be published to the publication
  • the server and correspondingly stores the event identifier and release identifier of the event to be released into the storage space indicated in the deduplication contract.
  • the blockchain system can include multiple storage spaces. After the blockchain system generates the event identifier according to the release identifier, the corresponding relationship between the two can be stored in the storage space indicated by the deduplication contract according to the release identifier.
  • the block system can determine the storage space indicated by the export and remittance contract from multiple storage spaces according to the timestamp of the release identifier of the event to be released, and store the event identifier and release identifier of the event to be released to the destination. In the storage space indicated by the contract.
  • the solution can also calculate the hash value of the release flag, take the key fields of the release flag, etc., to determine the storage space indicated by the deduplication contract.
  • the mapping structure mapping may be used to implement the mapping between the deduplication contract and multiple storage spaces. This solution can expand the space in the blockchain system for storing the corresponding relationship between the release ID and the event ID, and further improve the system performance.
  • the blockchain system After the blockchain system receives the transaction request sent by the publishing server, it does not directly generate a transaction log recording the event to be published, but first calls the deduplication contract to determine whether there is an event to be published in the blockchain system. If there is an event ID corresponding to the release ID, it can be determined that the event to be released has been successfully released to the blockchain system without re-publishing, that is, to prevent the publishing server from publishing the same event to the blockchain system, reducing the number of blocks
  • the chain system processes the number of events at the same time, reduces the work pressure of the blockchain system, and prevents consumers from subscribing to the same event, improving user experience.
  • FIG. 3 exemplarily shows the structure of a blockchain event deduplication device provided by an embodiment of the present invention, and the device can execute the process of the blockchain event deduplication method.
  • the transceiver unit 301 is configured to receive a transaction request sent by the publishing server; the transaction request is used to request the publication of an event; the transaction request includes the publication identifier of the event to be published;
  • the processing unit 302 is configured to call the deduplication contract to determine whether the event identifier corresponding to the release identifier is stored in the blockchain system; the event identifier is used to uniquely identify the published event;
  • the processing unit 302 is further configured to, if it is determined that the event identifier corresponding to the release identifier is stored in the blockchain system, control the transceiver unit 301 to send the event identifier corresponding to the release identifier to the release server.
  • processing unit 302 is further configured to:
  • Control the transceiver unit 301 to send the event identifier of the event to be published to the publishing server, and store the event identifier of the event to be published and the release identifier in the storage space indicated by the deduplication contract. .
  • the deduplication contract is set with a maximum storage duration
  • the processing unit 302 is further configured to:
  • the correspondence relationship between the release identifier and the event identifier that reaches the maximum storage duration is deleted from the storage space indicated by the deduplication contract.
  • the blockchain system includes multiple storage spaces
  • the processing unit 302 is specifically configured to:
  • the storage space indicated by the deduplication contract is determined from the multiple storage spaces; the event identifier of the event to be released and the release identifier are correspondingly stored in the destination Re-contract indicates in the storage space.
  • processing unit 302 is specifically configured to:
  • FIG. 4 exemplarily shows the structure of a blockchain event deduplication device provided by an embodiment of the present invention, and the device can execute the process of the blockchain event deduplication method.
  • the sending unit 401 is used to send a deployment request to the blockchain system; the deployment request is used to deploy a deduplication contract in the blockchain system; the deduplication contract is used to determine whether the blockchain system is stored to be released.
  • the receiving unit 402 is configured to receive a deployment response, where the deployment response is used to indicate that the deduplication contract is successfully deployed.
  • an embodiment of the present invention also provides a computer device, including:
  • Memory used to store program instructions
  • the processor is configured to call the program instructions stored in the memory, and execute the above blockchain event de-duplication method according to the obtained program.
  • embodiments of the present invention also provide a computer-readable non-volatile storage medium, including computer-readable instructions.
  • the computer reads and executes the computer-readable instructions, the computer executes the aforementioned blocks. Chain event de-duplication method.
  • inventions of the present invention also provide a computer program product.
  • the computer program product includes a computing program stored on a non-transitory computer-readable storage medium.
  • the computer program includes program instructions. When the instructions are executed by the computer, the computer executes the above-mentioned blockchain event deduplication method.
  • the present invention also provides an electronic device, as shown in FIG. 5, including:
  • processor 501 Including a processor 501, a memory 502, a transceiver 503, and a bus interface 504, wherein the processor 501, the memory 502 and the transceiver 503 are connected through the bus interface 504;
  • the processor 501 is configured to read a program in the memory 502 and execute the above-mentioned blockchain event deduplication method; the method includes:
  • N dependency trees are established, and one node of the dependency tree corresponds to a smart contract; N ⁇ 1;
  • the smart contracts corresponding to each node are issued in sequence.
  • the processor 501 may be a central processing unit (central processing unit, CPU for short), a network processor (NP for short), or a combination of CPU and NP. It can also be a hardware chip.
  • the aforementioned hardware chip may be an application-specific integrated circuit (ASIC for short), a programmable logic device (PLD for short), or a combination thereof.
  • ASIC application-specific integrated circuit
  • PLD programmable logic device
  • the above-mentioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (generic array logic, GAL), or any of them combination.
  • the memory 502 is configured to store one or more executable programs, and can store data used by the processor 501 when performing operations.
  • the program may include program code, and the program code includes computer operation instructions.
  • the memory 502 may include a volatile memory (volatile memory), such as random-access memory (RAM for short); the memory 502 may also include a non-volatile memory (non-volatile memory), such as flash memory ( flash memory, hard disk drive (HDD for short) or solid-state drive (SSD for short); the memory 502 may also include a combination of the foregoing types of memory.
  • volatile memory volatile memory
  • RAM random-access memory
  • non-volatile memory non-volatile memory
  • flash memory flash memory, hard disk drive (HDD for short) or solid-state drive (SSD for short
  • SSD solid-state drive
  • the memory 502 stores the following elements, executable modules or data structures, or their subsets, or their extended sets:
  • Operating instructions including various operating instructions, used to implement various operations.
  • Operating system including various system programs, used to implement various basic services and process hardware-based tasks.
  • the bus interface 504 may be a wired communication access port, a wireless bus interface or a combination thereof, where the wired bus interface may be, for example, an Ethernet interface.
  • the Ethernet interface can be an optical interface, an electrical interface or a combination thereof.
  • the wireless bus interface may be a WLAN interface.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.

Landscapes

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

Abstract

Disclosed are a blockchain event deduplication method and apparatus, a computer device and a storage medium. Said method comprises: a blockchain system receiving a transaction request sent by a publication server, the transaction request being used to request the publication of an event, and the transaction request comprising a publication identifier of the event to be published; the blockchain system invoking a deduplication contract; and if it is determined that the blockchain system stores an event identifier corresponding to the publication identifier, then sending the event identifier corresponding to the publication identifier to the publication server. The technical solution prevents a publication server from publishing the same event multiple times to a blockchain system, thereby reducing the pressure of the blockchain system.

Description

一种区块链事件去重方法、装置、计算机设备及存储介质Method, device, computer equipment and storage medium for deduplication of blockchain events
相关申请的交叉引用Cross references to related applications
本申请要求在2019年04月26日提交中国专利局、申请号为201910342419.8、申请名称为“一种区块链事件去重方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requires the priority of a Chinese patent application filed with the Chinese Patent Office on April 26, 2019, the application number is 201910342419.8, and the application title is "a method, device, computer equipment and storage medium for blockchain event deduplication". The entire content is incorporated into this application by reference.
技术领域Technical field
本发明实施例涉及金融科技(Fintech)领域,尤其涉及一种区块链(BlockChain)事件去重方法、装置、计算机设备及存储介质。The embodiments of the present invention relate to the field of financial technology (Fintech), and in particular to a method, device, computer equipment, and storage medium for deduplication of a blockchain (BlockChain) event.
背景技术Background technique
区块链是由一系列区块组成的一条链,每个区块记录本块的数据及上一块的哈希值,所有区块通过这种方式前后相继组成一条链。区块链所基于的密码学技术和去中心化思想使链上的历史信息无法被篡改。A blockchain is a chain composed of a series of blocks. Each block records the data of the block and the hash value of the previous block. In this way, all blocks form a chain one after another. The cryptographic technology and decentralized ideas on which the blockchain is based make the historical information on the chain unable to be tampered with.
随着计算机技术的发展,越来越多的技术应用在金融领域,传统金融业正在逐步向金融科技转变,区块链消息、事件传输技术也不例外,但由于金融、支付行业的安全性、实时性要求,也对技术提出的更高的要求。With the development of computer technology, more and more technologies are applied in the financial field. The traditional financial industry is gradually transforming to financial technology. Blockchain messaging and event transmission technology is no exception. However, due to the security, Real-time requirements also place higher requirements on technology.
在事件发布订阅中,生产者将待发布事件写入区块链系统,消费者从区块链系统读取待获取事件。当生产者发布事件至区块链系统后,若在预设时段内未收到区块链系统的应答消息,则会重新发布相同事件至区块链系统中,但区块链系统可同时处理事件的事件数量有限,若生产者多次发布相同事件至区块链系统中,则会造成区块链系统不必要的压力。In event publishing and subscription, the producer writes the event to be published into the blockchain system, and the consumer reads the event to be obtained from the blockchain system. When the producer publishes an event to the blockchain system, if it does not receive a response message from the blockchain system within the preset time period, it will republish the same event to the blockchain system, but the blockchain system can process it at the same time The number of events is limited. If producers publish the same event multiple times to the blockchain system, it will cause unnecessary pressure on the blockchain system.
发明内容Summary of the invention
本发明实施例提供一种区块链事件去重方法、装置、计算机设备及存储介质,避免发布服务器向区块链系统中多次发布相同事件,从而减少区块链 系统的压力。The embodiments of the present invention provide a method, device, computer equipment, and storage medium for deduplication of blockchain events, so as to prevent the publishing server from publishing the same event multiple times to the blockchain system, thereby reducing the pressure on the blockchain system.
第一方面,本发明实施例提供的一种区块链事件去重方法,包括:In the first aspect, a method for deduplication of blockchain events provided by an embodiment of the present invention includes:
区块链系统接收发布服务器发送的交易请求;所述交易请求用于请求发布事件;所述交易请求包括待发布事件的发布标识;The block chain system receives the transaction request sent by the publishing server; the transaction request is used to request the publication of the event; the transaction request includes the publication identification of the event to be published;
所述区块链系统调用去重合约,确定所述区块链系统中是否存储有所述发布标识对应的事件标识;所述事件标识用于唯一标识已发布事件;The blockchain system calls a deduplication contract to determine whether an event identifier corresponding to the release identifier is stored in the blockchain system; the event identifier is used to uniquely identify the published event;
所述区块链系统若确定所述区块链系统中存储有所述发布标识对应的事件标识,则将所述发布标识对应的事件标识发送至所述发布服务器。If the blockchain system determines that the event identifier corresponding to the release identifier is stored in the blockchain system, it sends the event identifier corresponding to the release identifier to the publishing server.
上述技术方案中,区块链系统接收发布服务器发送的交易请求后,不直接生成记录有待发布事件的交易日志,而是先通过调用去重合约,判断区块链系统中是否已经存在有待发布事件的发布标识对应的事件标识,若存在,则可以确定出该待发布事件已经成功发布至区块链系统中,无需再次发布,即避免发布服务器向区块链系统中多次发布相同事件,减少区块链系统在同时间处理事件的事件数量,减少区块链系统的工作压力,且避免消费者订阅到相同事件,提高用户体验。In the above technical solution, after the blockchain system receives the transaction request sent by the publishing server, it does not directly generate a transaction log recording the event to be published, but first calls the deduplication contract to determine whether there is an event to be published in the blockchain system If there is an event ID corresponding to the release ID, it can be determined that the event to be released has been successfully released to the blockchain system without re-publishing, that is, to avoid publishing the same event to the blockchain system by the publishing server multiple times, reducing The blockchain system processes the number of events at the same time, reducing the workload of the blockchain system, and avoiding consumers from subscribing to the same event, improving user experience.
可选的,还包括:Optional, also includes:
所述区块链系统若确定所述区块链系统中未存储有所述发布标识对应的事件标识,则调用所述待发布事件所属主题的主题合约;所述主题合约用于在交易日志中记录所述待发布事件及所述待发布事件的事件标识;If the blockchain system determines that the event identifier corresponding to the release identifier is not stored in the blockchain system, it calls the theme contract of the theme to which the event to be published belongs; the theme contract is used in the transaction log Record the event to be published and the event identifier of the event to be published;
所述区块链系统将所述待发布事件的事件标识发送至所述发布服务器,并将所述待发布事件的事件标识及所述发布标识对应存储至所述去重合约指示的存储空间中。The blockchain system sends the event identifier of the event to be published to the publishing server, and stores the event identifier of the event to be published and the release identifier in the storage space indicated by the deduplication contract. .
上述技术方案中,区块链系统接收发布服务器发送的交易请求后,若确定未存储有发布标识对应的事件标识,则确定出该待发布事件尚未被成功发布至区块链系统中,需要调用待发布事件所属主题的主题合约,执行发布,从而保障发布服务器发送的交易请求中的待发布事件被成功发布至区块链系统中。In the above technical solution, after the blockchain system receives the transaction request sent by the publishing server, if it is determined that the event identifier corresponding to the publishing identifier is not stored, it is determined that the event to be published has not been successfully published to the blockchain system and needs to be called The subject contract of the subject to which the event to be published belongs is released, so as to ensure that the event to be published in the transaction request sent by the publishing server is successfully published to the blockchain system.
可选的,所述去重合约设置有最大存储时长;Optionally, the deduplication contract is set with a maximum storage duration;
所述方法还包括:The method also includes:
所述区块链系统从所述去重合约指示的存储空间中删除到达最大存储时长的发布标识与事件标识的对应关系。The blockchain system deletes the correspondence relationship between the release identifier and the event identifier that reaches the maximum storage duration from the storage space indicated by the deduplication contract.
上述技术方案中,考虑到区块链系统中用于存储发布标识和事件标识对应关系的存储空间有限,且发布服务器发布相同事件的间隔时间较短,在去重合约中设置有最大存储时长,定期清除去重合约中的对应关系,避免出现去重合约的存储空间不够,导致功能受限的问题。且设置最大存储时长,可以减少去重合约在查找发布标识对应的事件标识时的工作量,进一步提高区块链系统的工作效率。In the above technical solution, considering that the storage space for storing the correspondence between the release identifier and the event identifier in the blockchain system is limited, and the release server publishes the same event at a relatively short interval, the maximum storage duration is set in the deduplication contract, Regularly clear the corresponding relationship in the deduplication contract to avoid the problem of insufficient storage space in the deduplication contract, resulting in limited functions. In addition, setting the maximum storage duration can reduce the workload of the deduplication contract in finding the event identifier corresponding to the release identifier, and further improve the work efficiency of the blockchain system.
可选的,所述区块链系统包括多个存储空间;Optionally, the blockchain system includes multiple storage spaces;
所述区块链系统将所述待发布事件的事件标识及所述发布标识对应存储至所述去重合约指示的存储空间中,包括:The block chain system correspondingly storing the event identifier of the event to be released and the release identifier in the storage space indicated by the deduplication contract includes:
所述区块链系统根据所述待发布事件的发布标识,从所述多个存储空间中确定出所述去重合约指示的存储空间;将所述待发布事件的事件标识及所述发布标识对应存储至所述去重合约指示存储空间中。The blockchain system determines the storage space indicated by the deduplication contract from the plurality of storage spaces according to the release identifier of the event to be published; the event identifier of the event to be released and the release identifier Correspondingly stored in the storage space of the deduplication contract instruction.
上述技术方案中,设置区块链系统中存储多个存储空间,并根据待发布事件,设定不同待发布事件映射到对应的存储空间中,从而实现将发布标识和事件标识的对应关系按照规则分类到多个存储空间中,更多存储发布标识和事件标识的对应关系。In the above technical solution, multiple storage spaces are stored in the blockchain system, and different to-be-published events are set to be mapped to corresponding storage spaces according to the events to be published, so as to realize the corresponding relationship between the release ID and the event ID in accordance with the rules Classified into multiple storage spaces, more storage of the corresponding relationship between the release ID and the event ID.
可选的,所述区块链系统调用去重合约,包括:Optionally, the blockchain system calling the deduplication contract includes:
所述区块链系统调用所述待发布事件所属主题的主题合约,通过所述待发布事件所属主题的主题合约调用所述去重合约。The blockchain system calls the theme contract of the theme to which the event to be published belongs, and calls the deduplication contract through the theme contract of the theme to which the event to be published belongs.
上述技术方案中,区块链系统在接收到交易请求后,先调用待发布事件所属主题的主题合约,并再从主题合约中调用去重合约,提高区块链系统在实际工作中的有序性。In the above technical solution, after receiving the transaction request, the blockchain system first calls the subject contract of the subject to which the event to be published belongs, and then calls the deduplication contract from the subject contract to improve the orderliness of the blockchain system in actual work Sex.
第二方面,本发明实施例还提供了一种区块链事件去重方法,包括:In the second aspect, an embodiment of the present invention also provides a method for deduplication of blockchain events, including:
发布服务器向区块链系统发送部署请求;所述部署请求用于在区块链系统部署去重合约;所述去重合约用于确定所述区块链系统中是否存储有待发布事件的发布标识对应的事件标识;所述事件标识用于唯一标识已发布事件;The publishing server sends a deployment request to the blockchain system; the deployment request is used to deploy a deduplication contract in the blockchain system; the deduplication contract is used to determine whether the blockchain system stores the release identifier of the event to be published Corresponding event identifier; the event identifier is used to uniquely identify the published event;
所述发布服务器接收部署响应,所述部署响应用于指示所述去重合约部署成功。The publishing server receives a deployment response, where the deployment response is used to indicate that the deduplication contract is successfully deployed.
上述技术方案中,发布服务器预先向区块链系统中部署去重合约,用于在向区块链系统中发送交易请求时,区块链系统可以将相同的事件过滤掉,同时向发布服务器反馈发布标识对应的事件标识,避免发布服务器向区块链系统多次发布相同事件的交易请求,提高发布服务器的工作效率。In the above technical solution, the publishing server pre-deploys a deduplication contract in the blockchain system for when sending transaction requests to the blockchain system, the blockchain system can filter out the same events and feed back to the publishing server at the same time The event identifier corresponding to the publishing identifier prevents the publishing server from issuing multiple transaction requests for the same event to the blockchain system, and improves the working efficiency of the publishing server.
第三方面,本发明实施例还提供了一种区块链事件去重装置,包括:In the third aspect, an embodiment of the present invention also provides a blockchain event deduplication device, including:
收发单元,用于接收发布服务器发送的交易请求;所述交易请求用于请求发布事件;所述交易请求包括待发布事件的发布标识;The transceiver unit is configured to receive a transaction request sent by the publishing server; the transaction request is used to request the publication of the event; the transaction request includes the publication identification of the event to be published;
处理单元,用于调用去重合约,确定区块链系统中是否存储有所述发布标识对应的事件标识;所述事件标识用于唯一标识已发布事件;The processing unit is used to call the deduplication contract to determine whether the event identifier corresponding to the release identifier is stored in the blockchain system; the event identifier is used to uniquely identify the published event;
所述处理单元,还用于若确定所述区块链系统中存储有所述发布标识对应的事件标识,则控制所述收发单元将所述发布标识对应的事件标识发送至所述发布服务器。The processing unit is further configured to, if it is determined that the event identifier corresponding to the release identifier is stored in the blockchain system, control the transceiver unit to send the event identifier corresponding to the release identifier to the publishing server.
可选的,所述处理单元,还用于:Optionally, the processing unit is further configured to:
若确定所述区块链系统中未存储有所述发布标识对应的事件标识,则调用所述待发布事件所属主题的主题合约;所述主题合约用于在交易日志中记录所述待发布事件及所述待发布事件的事件标识;If it is determined that the event identifier corresponding to the release identifier is not stored in the blockchain system, call the theme contract of the theme to which the event to be published belongs; the theme contract is used to record the event to be published in the transaction log And the event identifier of the event to be released;
控制所述收发单元将所述待发布事件的事件标识发送至所述发布服务器,并将所述待发布事件的事件标识及所述发布标识对应存储至所述去重合约指示的存储空间中。Control the transceiver unit to send the event identifier of the event to be published to the publishing server, and correspondingly store the event identifier of the event to be published and the release identifier in the storage space indicated by the deduplication contract.
可选的,所述去重合约设置有最大存储时长;Optionally, the deduplication contract is set with a maximum storage duration;
所述处理单元,还用于:The processing unit is also used for:
从所述去重合约指示的存储空间中删除到达最大存储时长的发布标识与 事件标识的对应关系。The correspondence relationship between the release identifier and the event identifier that reaches the maximum storage duration is deleted from the storage space indicated by the deduplication contract.
可选的,所述区块链系统包括多个存储空间;Optionally, the blockchain system includes multiple storage spaces;
所述处理单元,具体用于:The processing unit is specifically used for:
根据所述待发布事件的发布标识,从所述多个存储空间中确定出所述去重合约指示的存储空间;将所述待发布事件的事件标识及所述发布标识对应存储至所述去重合约指示存储空间中。According to the release identifier of the event to be released, the storage space indicated by the deduplication contract is determined from the multiple storage spaces; the event identifier of the event to be released and the release identifier are correspondingly stored in the destination Re-contract indicates in the storage space.
可选的,所述处理单元具体用于:Optionally, the processing unit is specifically configured to:
调用所述待发布事件所属主题的主题合约,通过所述待发布事件所属主题的主题合约调用所述去重合约。Call the theme contract of the theme to which the event to be published belongs, and call the deduplication contract through the theme contract of the theme to which the event to be published belongs.
第四方面,本发明实施例还提供了一种区块链事件去重装置,包括:In a fourth aspect, an embodiment of the present invention also provides a blockchain event deduplication device, including:
发送单元,用于向区块链系统发送部署请求;所述部署请求用于在区块链系统部署去重合约;所述去重合约用于确定所述区块链系统中是否存储有待发布事件的发布标识对应的事件标识;所述事件标识用于唯一标识已发布事件;The sending unit is used to send a deployment request to the blockchain system; the deployment request is used to deploy a deduplication contract in the blockchain system; the deduplication contract is used to determine whether there are events to be published in the blockchain system The event identifier corresponding to the release identifier of, the event identifier is used to uniquely identify the published event;
接收单元,用于接收部署响应,所述部署响应用于指示所述去重合约部署成功。The receiving unit is configured to receive a deployment response, where the deployment response is used to indicate that the deduplication contract is successfully deployed.
第五方面,本发明实施例还提供了一种计算机设备,包括:In a fifth aspect, an embodiment of the present invention also provides a computer device, including:
存储器,用于存储程序指令;Memory, used to store program instructions;
处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行上述区块链事件去重方法。The processor is configured to call the program instructions stored in the memory, and execute the above blockchain event de-duplication method according to the obtained program.
第六方面,本发明实施例还提供了一种计算机可读非易失性存储介质,包括计算机可读指令,当计算机读取并执行所述计算机可读指令时,使得计算机执行上述区块链事件去重方法。In a sixth aspect, embodiments of the present invention also provide a computer-readable non-volatile storage medium, including computer-readable instructions, which when the computer reads and executes the computer-readable instructions, cause the computer to execute the aforementioned blockchain Event deduplication method.
第七方面,本发明实施例还提供了一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行上述区块链事件去重方法。In a seventh aspect, an embodiment of the present invention also provides a computer program product, the computer program product includes a calculation program stored on a non-transitory computer-readable storage medium, the computer program includes program instructions, when the program When the instruction is executed by the computer, the computer is caused to execute the above-mentioned blockchain event deduplication method.
附图说明Description of the drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly describe the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings needed in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative work, other drawings can be obtained from these drawings.
图1为本发明实施例提供的一种系统架构的示意图;FIG. 1 is a schematic diagram of a system architecture provided by an embodiment of the present invention;
图2为本发明实施例提供的一种区块链事件去重方法的流程示意图;2 is a schematic flowchart of a method for deduplication of blockchain events according to an embodiment of the present invention;
图3为本发明实施例提供的一种区块链事件去重装置的结构示意图;3 is a schematic structural diagram of a device for deduplication of blockchain events provided by an embodiment of the present invention;
图4为本发明实施例提供的一种区块链事件去重装置的结构示意图;4 is a schematic structural diagram of a device for deduplication of blockchain events provided by an embodiment of the present invention;
图5为本发明实施例提供的一种电子设备的结构示意图。FIG. 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.
具体实施方式Detailed ways
为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.
图1示例性的示出了本发明实施例提供区块链事件去重方法所适用的系统架构,该系统架构可以包括生产者100、发布服务器200、区块链系统300、订阅服务器400、消费者500。其中,生产者100用于生成待发布事件,发布服务器200用于将待发布事件写入区块链系统300中,消费者500用于通过订阅服务器400从区块链系统300中订阅事件。FIG. 1 exemplarily shows the system architecture applicable to the method for deduplication of blockchain events provided by the embodiment of the present invention. The system architecture may include a producer 100, a publishing server 200, a blockchain system 300, a subscriber server 400, and a consumer者500. Among them, the producer 100 is used to generate events to be published, the publishing server 200 is used to write the events to be published into the blockchain system 300, and the consumer 500 is used to subscribe to events from the blockchain system 300 through the subscription server 400.
生产者100需要发布事件时,将待发布事件发送至发布服务器200,发布服务器200根据待发布事件生成交易请求,发布服务器200将交易请求发送至区块链系统300,区块链系统300根据交易请求执行合约并记录该待发布事件,即完成生产者100的事件发布。When the producer 100 needs to publish an event, it sends the event to be published to the publishing server 200, the publishing server 200 generates a transaction request according to the event to be published, the publishing server 200 sends the transaction request to the blockchain system 300, and the blockchain system 300 according to the transaction Request to execute the contract and record the event to be released, that is, the event release of the producer 100 is completed.
消费者500需要获取事件时,向订阅服务器400发送获取请求,订阅服 务器400根据接收到的获取请求从区块链系统300中确定出获取请求对应的事件,反馈至消费者500,即完成消费者500的事件订阅。When the consumer 500 needs to acquire an event, it sends an acquisition request to the subscription server 400. The subscription server 400 determines the event corresponding to the acquisition request from the blockchain system 300 according to the received acquisition request, and feeds it back to the consumer 500 to complete the consumer 500 event subscriptions.
本系统架构中的发布服务器200和订阅服务器400在物理实体上可以为一个服务器,该服务器完成发布和订阅功能,也可以为两个分开的服务器,分别完成发布功能和订阅功能,在此不做限制。The publishing server 200 and the subscribing server 400 in the system architecture can be one server physically, which completes publishing and subscribing functions, or two separate servers, which complete publishing and subscribing functions respectively, which will not be done here. limit.
区块链系统300根据交易请求执行合约并记录该待发布事件,待发布事件经发布后,存储在区块链系统300中,由于区块链系统300为链式结构,具有不易被篡改和删除的特性,保障了发布事件储存在区块链系统300内的安全性。The blockchain system 300 executes the contract according to the transaction request and records the event to be released. After the event is released, it is stored in the blockchain system 300. Since the blockchain system 300 is a chain structure, it is not easy to be tampered with and deleted. The feature of, guarantees the security of the release event stored in the blockchain system 300.
发布服务器200在向区块链系统300发送交易请求后,若发布服务器200可以从区块链系统300获取到发布事件的应答消息,且该应答消息中记录有发布事件的事件标识,则发布服务器200认定待发布事件被成功发布至区块链系统300中,否则,发布服务器200则会认定待发布事件尚未被成功发布至区块链系统300,需要向区块链系统300再次发布该待发布事件,结合该描述,本发明实施例涉及场景有:After the publishing server 200 sends a transaction request to the blockchain system 300, if the publishing server 200 can obtain a response message for publishing events from the blockchain system 300, and the response message records the event identifier of the publishing event, the publishing server 200 determines that the event to be published has been successfully published to the blockchain system 300, otherwise, the publishing server 200 will determine that the event to be published has not been successfully published to the blockchain system 300 and needs to publish the to-be published event to the blockchain system 300 again Events, combined with the description, the scenarios involved in the embodiments of the present invention are:
场景一:发布服务器向区块链系统发送交易请求,区块链系统成功生成交易日志,并反馈应答消息,该应答消息中存在发布事件的事件标识,发布服务器接收该应答消息,确定事件发布成功。Scenario 1: The publishing server sends a transaction request to the blockchain system. The blockchain system successfully generates a transaction log and feeds back a response message. The response message contains the event identifier of the publishing event. The publishing server receives the response message and determines that the event is successfully published. .
场景二:发布服务器向区块链系统发送交易请求,区块链系统成功生成交易日志,但发布服务器未收到区块链系统反馈的应答消息,或反馈的应答消息中不存在发布事件的事件标识,则发布服务器认为事件发布未成功,需要进行重新发布,将相同事件存储至交易请求中发送至区块链系统,区块链系统确定区块链系统中已经存储有发布事件的事件标识,则向发布服务器反馈发布事件的事件标识,从而告知发布服务器事件已经发布成功。Scenario 2: The publishing server sends a transaction request to the blockchain system. The blockchain system successfully generates a transaction log, but the publishing server does not receive a response message from the blockchain system, or there is no event publishing event in the response message. ID, the publishing server considers the event to be published unsuccessfully and needs to be republished, stores the same event in the transaction request and sends it to the blockchain system. The blockchain system determines that the event identifier for the published event has been stored in the blockchain system. Then, the event identifier of the publishing event is fed back to the publishing server to inform the publishing server that the event has been successfully published.
场景三:发布服务器向区块链系统发送交易请求,区块链系统未成功生成交易日志,发布服务器未收到区块链系统反馈的应答消息,或反馈的应答消息中不存在发布事件的事件标识,则发布服务器认为事件发布未成功,需 要进行重新发布,将相同事件存储至交易请求中发送至区块链系统,区块链系统确定区块链系统中未存储有发布事件的事件标识,则调用待发布事件所属主题的主题合约,生成交易日志,并反馈记录有发布事件的事件标识的应答消息至发布服务器,从而告知发布服务器事件已经发布成功。Scenario 3: The publishing server sends a transaction request to the blockchain system, the blockchain system fails to generate a transaction log, the publishing server does not receive the response message fed back by the blockchain system, or there is no event publishing event in the response message fed back The publishing server considers that the event is not successfully published and needs to be republished. The same event is stored in the transaction request and sent to the blockchain system. The blockchain system determines that the event identifier of the published event is not stored in the blockchain system. The subject contract of the subject to which the event to be published belongs is called, a transaction log is generated, and a response message recording the event identifier of the published event is fed back to the publishing server, thereby notifying the publishing server that the event has been successfully published.
结合上述场景,图2示例性的示出了本发明实施例提供的一种区块链事件去重方法的流程,该流程可以由区块链事件去重装置执行,该装置可以位于区块链系统中,可以是该区块链系统。如图2所示,该流程涉及执行主体有发布服务器、区块链系统,具体流程如下。In combination with the above scenarios, Figure 2 exemplarily shows the flow of a blockchain event deduplication method provided by an embodiment of the present invention. The flow can be executed by a blockchain event deduplication device, which can be located in the blockchain. In the system, it can be the blockchain system. As shown in Figure 2, the process involves the execution subject including the publishing server and the blockchain system. The specific process is as follows.
步骤201,发布服务器发送交易请求至区块链系统。Step 201: The publishing server sends a transaction request to the blockchain system.
发布服务器接收生产者发送的发布请求,根据发布请求生成交易请求,并发送至区块链系统中,其中,交易请求用于请求发布事件,交易请求中包括待发布事件的发布标识。待发布事件的发布标识可以包括待发布事件的生产者IP(Internet Protocol,网络之间互连的协议)地址、线程ID(Identification,身份标识号)、时间戳、时间内递增值等信息,用于唯一确定该待发布事件,示例性的,待发布事件的发布标识可以为待发布事件的UUID(Universally Unique Identifier,通用唯一识别码)。The publishing server receives the publishing request sent by the producer, generates a transaction request according to the publishing request, and sends it to the blockchain system. The transaction request is used to request the publishing of the event, and the transaction request includes the publishing identification of the event to be published. The release identifier of the event to be released can include the producer IP (Internet Protocol, interconnection protocol between networks) address, thread ID (Identification), timestamp, time increment value and other information of the event to be released. To uniquely determine the event to be published, for example, the publication identifier of the event to be published may be the UUID (Universally Unique Identifier) of the event to be published.
进一步的,待发布事件的发布标识可以是生产者生成的,也可以是发布服务器生成的,当发布服务器生成待发布事件的发布标识时,根据一定的规律,将接收到的所有待发布事件进行标识,以保障待发布事件的发布标识用于唯一确定该待发布事件。Further, the release identifier of the event to be published can be generated by the producer or the publishing server. When the publishing server generates the release identifier of the event to be published, it will perform all received events to be published according to certain rules. ID to ensure that the release ID of the event to be released is used to uniquely identify the event to be released.
步骤202,区块链系统调用去重合约。Step 202, the blockchain system calls the deduplication contract.
区块链系统中可以部署去重合约,该去重合约用于防止发布服务器将相同的待发布事件发布至区块链系统中,具体的,通过去重合约确定区块链系统中是否存储有待发布事件的发布标识对应的事件标识,以避免发布服务器将相同待发布事件发布至区块链系统中。A deduplication contract can be deployed in the blockchain system. The deduplication contract is used to prevent the publishing server from publishing the same pending event to the blockchain system. Specifically, the deduplication contract is used to determine whether there is a pending storage in the blockchain system Publish the event identifier corresponding to the issue identifier of the event to prevent the publishing server from publishing the same pending event to the blockchain system.
本发明实施例中,发布服务器可以预先部署该去重合约,具体的,发布服务器向区块链系统发送部署请求,该部署请求即用于在区块链系统中部署 去重合约,区块链系统在接收到部署请求后,即根据部署请求在区块链系统中部署该去重合约,区块链系统将去重合约部署完成后,发送部署响应至发布服务器,以通知发布服务器部署成功。In the embodiment of the present invention, the publishing server may pre-deploy the deduplication contract. Specifically, the publishing server sends a deployment request to the blockchain system. The deployment request is used to deploy the deduplication contract in the blockchain system. After the system receives the deployment request, it deploys the deduplication contract in the blockchain system according to the deployment request. After the deduplication contract is deployed, the blockchain system sends a deployment response to the publishing server to notify the publishing server that the deployment is successful.
步骤203,区块链系统确定区块链系统中是否存储有事件标识。Step 203: The blockchain system determines whether an event identifier is stored in the blockchain system.
待发布事件若在区块链系统中发布成功,区块链系统会生成记录有该待发布事件的交易日志,该交易日志的生成即意味着该待发布事件变为已发布事件,交易日志中记录有事件标识,该事件标识用于唯一标识已发布事件,也与待发布事件的发布标识呈对应关系。If the event to be released is successfully released in the blockchain system, the blockchain system will generate a transaction log that records the event to be released. The generation of the transaction log means that the event to be released becomes a published event, and the transaction log is The event identifier is recorded, and the event identifier is used to uniquely identify the published event and also has a corresponding relationship with the release identifier of the event to be published.
本发明实施例中,事件的发布标识与事件标识的对应关系可以存储在去重合约所指示的存储空间中,区块链系统可以直接调用去重合约,确定去重合约所指示的存储空间中是否存储有待发布事件的发布标识对应的事件标识。也可以通过待发布事件所属主题的主题合约调用去重合约,即区块链系统调用待发布事件所属主题的主题合约,通过待发布事件所属主题的主题合约调用去重合约。In the embodiment of the present invention, the corresponding relationship between the release identifier of the event and the event identifier can be stored in the storage space indicated by the deduplication contract, and the blockchain system can directly call the deduplication contract to determine the storage space indicated by the deduplication contract Whether to store the event ID corresponding to the release ID of the event to be released. It is also possible to call the deduplication contract through the theme contract of the theme to which the event to be published belongs, that is, the blockchain system calls the theme contract of the theme to which the event to be published belongs, and calls the deduplication contract through the theme contract of the theme to which the event belongs.
本发明实施例中,由于区块链系统中去重合约指示的存储空间有限,且发布服务器发布相同事件的间隔时间较短,则可以在去重合约中设置最大存储时长,若存储在去重合约中的事件的发布标识与事件标识的对应关系超过最大存储时长,则删除二者的对应关系。In the embodiment of the present invention, since the storage space indicated by the deduplication contract in the blockchain system is limited, and the release server publishes the same event at a relatively short interval, the maximum storage duration can be set in the deduplication contract. The corresponding relationship between the release identifier of the event in the contract and the event identifier exceeds the maximum storage time, then the corresponding relationship between the two is deleted.
步骤204,区块链系统将发布标识对应的事件标识发送至发布服务器。In step 204, the blockchain system sends the event identifier corresponding to the issuing identifier to the issuing server.
若区块链系统中存储有发布标识对应的事件标识,则确定待发布事件发布完成,将确定出的发布标识对应的事件标识发送至发布服务器,以告知发布服务器该待发布事件已经发布完成。If the event identifier corresponding to the release identifier is stored in the blockchain system, it is determined that the release of the event to be published is completed, and the event identifier corresponding to the determined release identifier is sent to the publishing server to inform the publishing server that the event to be published has been completed.
当然,本发明实施例中,还可能存在区块链系统确定区块链系统中未存储有事件标识,则确定还未发布该待发布事件,区块链系统需执行合约发布该待发布事件,具体的,区块链系统调用待发布事件所属主题的主题合约,以生成记录有该待发布事件及待发布事件的事件标识的交易日志,区块链系统将待发布事件的事件标识发送至发布服务器,并将待发布事件的事件标识 及发布标识对应存储至去重合约中所指示的存储空间中。Of course, in the embodiment of the present invention, there may be a blockchain system that determines that the event identifier is not stored in the blockchain system, and then determines that the event to be released has not been released, and the blockchain system needs to execute a contract to release the event to be released. Specifically, the blockchain system calls the subject contract of the subject of the event to be published to generate a transaction log that records the event to be published and the event identifier of the event to be published, and the blockchain system sends the event identifier of the event to be published to the publication The server, and correspondingly stores the event identifier and release identifier of the event to be released into the storage space indicated in the deduplication contract.
进一步的,为提高系统性能,还可以设置区块链系统中包括多个存储空间。在区块链系统根据发布标识生成事件标识后,可以将二者的对应关系根据发布标识存储至去重合约所指示的存储空间中。可选的,区块系统可以根据待发布事件的发布标识的时间戳,从多个存储空间中确定出去重合约所指示的存储空间,并将待发布事件的事件标识及发布标识对应存储至去重合约指示的存储空间中。相应的,在判断区块链系统中是否存储有发布标识对应的事件标识时,也可以先根据待发布事件的发布标识的时间戳,确定去重合约所指示的存储空间,并从该存储空间中查找是否存储有该发布标识对应的事件标识。此外,该方案还可以计算发布标识的哈希值、取发布标识的关键字段等方式,以确定去重合约所指示的存储空间。示例性的,可以采用映射结构mapping实现去重合约与多个存储空间的映射。该方案可以扩充区块链系统中用于存储发布标识和事件标识对应关系的空间,进一步提高系统性能。Further, in order to improve system performance, it is also possible to set the blockchain system to include multiple storage spaces. After the blockchain system generates the event identifier according to the release identifier, the corresponding relationship between the two can be stored in the storage space indicated by the deduplication contract according to the release identifier. Optionally, the block system can determine the storage space indicated by the export and remittance contract from multiple storage spaces according to the timestamp of the release identifier of the event to be released, and store the event identifier and release identifier of the event to be released to the destination. In the storage space indicated by the contract. Correspondingly, when judging whether the event identifier corresponding to the release identifier is stored in the blockchain system, it is also possible to first determine the storage space indicated by the deduplication contract according to the time stamp of the release identifier of the event to be released, and use the storage space Check whether the event ID corresponding to the release ID is stored. In addition, the solution can also calculate the hash value of the release flag, take the key fields of the release flag, etc., to determine the storage space indicated by the deduplication contract. Exemplarily, the mapping structure mapping may be used to implement the mapping between the deduplication contract and multiple storage spaces. This solution can expand the space in the blockchain system for storing the corresponding relationship between the release ID and the event ID, and further improve the system performance.
上述实施例中,区块链系统接收发布服务器发送的交易请求后,不直接生成记录有待发布事件的交易日志,而是先通过调用去重合约,判断区块链系统中是否已经存在有待发布事件的发布标识对应的事件标识,若存在,则可以确定出该待发布事件已经成功发布至区块链系统中,无需再次发布,即避免发布服务器向区块链系统中发布相同事件,减少区块链系统在同时间处理事件的事件数量,减少区块链系统的工作压力,且避免消费者订阅到相同事件,提高用户体验。In the above embodiment, after the blockchain system receives the transaction request sent by the publishing server, it does not directly generate a transaction log recording the event to be published, but first calls the deduplication contract to determine whether there is an event to be published in the blockchain system. If there is an event ID corresponding to the release ID, it can be determined that the event to be released has been successfully released to the blockchain system without re-publishing, that is, to prevent the publishing server from publishing the same event to the blockchain system, reducing the number of blocks The chain system processes the number of events at the same time, reduces the work pressure of the blockchain system, and prevents consumers from subscribing to the same event, improving user experience.
基于同一发明构思,图3示例性的示出了本发明实施例提供的一种区块链事件去重装置的结构,该装置可以执行区块链事件去重方法的流程。Based on the same inventive concept, FIG. 3 exemplarily shows the structure of a blockchain event deduplication device provided by an embodiment of the present invention, and the device can execute the process of the blockchain event deduplication method.
收发单元301,用于接收发布服务器发送的交易请求;所述交易请求用于请求发布事件;所述交易请求包括待发布事件的发布标识;The transceiver unit 301 is configured to receive a transaction request sent by the publishing server; the transaction request is used to request the publication of an event; the transaction request includes the publication identifier of the event to be published;
处理单元302,用于调用去重合约,确定区块链系统中是否存储有所述发布标识对应的事件标识;所述事件标识用于唯一标识已发布事件;The processing unit 302 is configured to call the deduplication contract to determine whether the event identifier corresponding to the release identifier is stored in the blockchain system; the event identifier is used to uniquely identify the published event;
所述处理单元302,还用于若确定所述区块链系统中存储有所述发布标识 对应的事件标识,则控制所述收发单元301将所述发布标识对应的事件标识发送至所述发布服务器。The processing unit 302 is further configured to, if it is determined that the event identifier corresponding to the release identifier is stored in the blockchain system, control the transceiver unit 301 to send the event identifier corresponding to the release identifier to the release server.
可选的,所述处理单元302,还用于:Optionally, the processing unit 302 is further configured to:
若确定所述区块链系统中未存储有所述发布标识对应的事件标识,则调用所述待发布事件所属主题的主题合约;所述主题合约用于在交易日志中记录所述待发布事件及所述待发布事件的事件标识;If it is determined that the event identifier corresponding to the release identifier is not stored in the blockchain system, call the theme contract of the theme to which the event to be published belongs; the theme contract is used to record the event to be published in the transaction log And the event identifier of the event to be released;
控制所述收发单元301将所述待发布事件的事件标识发送至所述发布服务器,并将所述待发布事件的事件标识及所述发布标识对应存储至所述去重合约指示的存储空间中。Control the transceiver unit 301 to send the event identifier of the event to be published to the publishing server, and store the event identifier of the event to be published and the release identifier in the storage space indicated by the deduplication contract. .
可选的,所述去重合约设置有最大存储时长;Optionally, the deduplication contract is set with a maximum storage duration;
所述处理单元302,还用于:The processing unit 302 is further configured to:
从所述去重合约指示的存储空间中删除到达最大存储时长的发布标识与事件标识的对应关系。The correspondence relationship between the release identifier and the event identifier that reaches the maximum storage duration is deleted from the storage space indicated by the deduplication contract.
可选的,所述区块链系统包括多个存储空间;Optionally, the blockchain system includes multiple storage spaces;
所述处理单元302,具体用于:The processing unit 302 is specifically configured to:
根据所述待发布事件的发布标识,从所述多个存储空间中确定出所述去重合约指示的存储空间;将所述待发布事件的事件标识及所述发布标识对应存储至所述去重合约指示存储空间中。According to the release identifier of the event to be released, the storage space indicated by the deduplication contract is determined from the multiple storage spaces; the event identifier of the event to be released and the release identifier are correspondingly stored in the destination Re-contract indicates in the storage space.
可选的,所述处理单元302具体用于:Optionally, the processing unit 302 is specifically configured to:
调用所述待发布事件所属主题的主题合约,通过所述待发布事件所属主题的主题合约调用所述去重合约。Call the theme contract of the theme to which the event to be published belongs, and call the deduplication contract through the theme contract of the theme to which the event to be published belongs.
基于同一发明构思,图4示例性的示出了本发明实施例提供的一种区块链事件去重装置的结构,该装置可以执行区块链事件去重方法的流程。Based on the same inventive concept, FIG. 4 exemplarily shows the structure of a blockchain event deduplication device provided by an embodiment of the present invention, and the device can execute the process of the blockchain event deduplication method.
发送单元401,用于向区块链系统发送部署请求;所述部署请求用于在区块链系统部署去重合约;所述去重合约用于确定所述区块链系统中是否存储有待发布事件的发布标识对应的事件标识;所述事件标识用于唯一标识已发布事件;The sending unit 401 is used to send a deployment request to the blockchain system; the deployment request is used to deploy a deduplication contract in the blockchain system; the deduplication contract is used to determine whether the blockchain system is stored to be released The event identifier corresponding to the issue identifier of the event; the event identifier is used to uniquely identify the published event;
接收单元402,用于接收部署响应,所述部署响应用于指示所述去重合约部署成功。The receiving unit 402 is configured to receive a deployment response, where the deployment response is used to indicate that the deduplication contract is successfully deployed.
基于同一发明构思,本发明实施例还提供了一种计算机设备,包括:Based on the same inventive concept, an embodiment of the present invention also provides a computer device, including:
存储器,用于存储程序指令;Memory, used to store program instructions;
处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行上述区块链事件去重方法。The processor is configured to call the program instructions stored in the memory, and execute the above blockchain event de-duplication method according to the obtained program.
基于同一发明构思,本发明实施例还提供了一种计算机可读非易失性存储介质,包括计算机可读指令,当计算机读取并执行所述计算机可读指令时,使得计算机执行上述区块链事件去重方法。Based on the same inventive concept, embodiments of the present invention also provide a computer-readable non-volatile storage medium, including computer-readable instructions. When the computer reads and executes the computer-readable instructions, the computer executes the aforementioned blocks. Chain event de-duplication method.
基于同一发明构思,本发明实施例还提供一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使得计算机执行上述区块链事件去重方法。Based on the same inventive concept, embodiments of the present invention also provide a computer program product. The computer program product includes a computing program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the instructions are executed by the computer, the computer executes the above-mentioned blockchain event deduplication method.
基于相同的原理,本发明还提供一种电子设备,如图5所示,包括:Based on the same principle, the present invention also provides an electronic device, as shown in FIG. 5, including:
包括处理器501、存储器502、收发机503、总线接口504,其中处理器501、存储器502与收发机503之间通过总线接口504连接;Including a processor 501, a memory 502, a transceiver 503, and a bus interface 504, wherein the processor 501, the memory 502 and the transceiver 503 are connected through the bus interface 504;
所述处理器501,用于读取所述存储器502中的程序,执行上述区块链事件去重方法;所述方法包括:The processor 501 is configured to read a program in the memory 502 and execute the above-mentioned blockchain event deduplication method; the method includes:
获取待发布的智能合约;Obtain the smart contract to be released;
遍历所述待发布的智能合约,确定所述待发布的智能合约之间的依赖关系;Traverse the smart contracts to be released, and determine the dependencies between the smart contracts to be released;
依据所述依赖关系,建立N个依赖树,所述依赖树的一个节点对应一个智能合约;N≥1;According to the dependency relationship, N dependency trees are established, and one node of the dependency tree corresponds to a smart contract; N≥1;
针对任一依赖树,从所述依赖树的叶子节点开始,直至所述依赖树的根节点,依次发布各节点所对应的智能合约。For any dependency tree, starting from the leaf nodes of the dependency tree and ending with the root node of the dependency tree, the smart contracts corresponding to each node are issued in sequence.
所述处理器501可以是中央处理器(central processing unit,简称CPU),网络处理器(network processor,简称NP)或者CPU和NP的组合。还可以 是硬件芯片。上述硬件芯片可以是专用集成电路(application-specific integrated circuit,简称ASIC),可编程逻辑器件(programmable logic device,简称PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,简称CPLD),现场可编程逻辑门阵列(field-programmable gate array,简称FPGA),通用阵列逻辑(generic array logic,简称GAL)或其任意组合。The processor 501 may be a central processing unit (central processing unit, CPU for short), a network processor (NP for short), or a combination of CPU and NP. It can also be a hardware chip. The aforementioned hardware chip may be an application-specific integrated circuit (ASIC for short), a programmable logic device (PLD for short), or a combination thereof. The above-mentioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (generic array logic, GAL), or any of them combination.
所述存储器502,用于存储一个或多个可执行程序,可以存储所述处理器501在执行操作时所使用的数据。The memory 502 is configured to store one or more executable programs, and can store data used by the processor 501 when performing operations.
具体地,程序可以包括程序代码,程序代码包括计算机操作指令。存储器502可以包括易失性存储器(volatile memory),例如随机存取存储器(random-access memory,简称RAM);存储器502也可以包括非易失性存储器(non-volatile memory),例如快闪存储器(flash memory),硬盘(hard disk drive,简称HDD)或固态硬盘(solid-state drive,简称SSD);存储器502还可以包括上述种类的存储器的组合。Specifically, the program may include program code, and the program code includes computer operation instructions. The memory 502 may include a volatile memory (volatile memory), such as random-access memory (RAM for short); the memory 502 may also include a non-volatile memory (non-volatile memory), such as flash memory ( flash memory, hard disk drive (HDD for short) or solid-state drive (SSD for short); the memory 502 may also include a combination of the foregoing types of memory.
存储器502存储了如下的元素,可执行模块或者数据结构,或者它们的子集,或者它们的扩展集:The memory 502 stores the following elements, executable modules or data structures, or their subsets, or their extended sets:
操作指令:包括各种操作指令,用于实现各种操作。Operating instructions: including various operating instructions, used to implement various operations.
操作系统:包括各种系统程序,用于实现各种基础业务以及处理基于硬件的任务。Operating system: including various system programs, used to implement various basic services and process hardware-based tasks.
总线接口504可以为有线通信接入口,无线总线接口或其组合,其中,有线总线接口例如可以为以太网接口。以太网接口可以是光接口,电接口或其组合。无线总线接口可以为WLAN接口。The bus interface 504 may be a wired communication access port, a wireless bus interface or a combination thereof, where the wired bus interface may be, for example, an Ethernet interface. The Ethernet interface can be an optical interface, an electrical interface or a combination thereof. The wireless bus interface may be a WLAN interface.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流 程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowcharts and/or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and/or block in the flowchart and/or block diagram, and the combination of processes and/or blocks in the flowchart and/or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing equipment to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing equipment are generated It is a device that realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device. The device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment. The instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications to these embodiments once they learn the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present invention.
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. In this way, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these modifications and variations.

Claims (15)

  1. 一种区块链事件去重方法,其特征在于,包括:A method for deduplication of blockchain events, which is characterized in that it includes:
    区块链系统接收发布服务器发送的交易请求;所述交易请求用于请求发布事件;所述交易请求包括待发布事件的发布标识;The block chain system receives the transaction request sent by the publishing server; the transaction request is used to request the publication of the event; the transaction request includes the publication identification of the event to be published;
    所述区块链系统调用去重合约,确定所述区块链系统中是否存储有所述发布标识对应的事件标识;所述事件标识用于唯一标识已发布事件;The blockchain system calls a deduplication contract to determine whether an event identifier corresponding to the release identifier is stored in the blockchain system; the event identifier is used to uniquely identify the published event;
    所述区块链系统若确定所述区块链系统中存储有所述发布标识对应的事件标识,则将所述发布标识对应的事件标识发送至所述发布服务器。If the blockchain system determines that the event identifier corresponding to the release identifier is stored in the blockchain system, it sends the event identifier corresponding to the release identifier to the publishing server.
  2. 如权利要求1所述的方法,其特征在于,还包括:The method of claim 1, further comprising:
    所述区块链系统若确定所述区块链系统中未存储有所述发布标识对应的事件标识,则调用所述待发布事件所属主题的主题合约;所述主题合约用于在交易日志中记录所述待发布事件及所述待发布事件的事件标识;If the blockchain system determines that the event identifier corresponding to the release identifier is not stored in the blockchain system, it calls the theme contract of the theme to which the event to be published belongs; the theme contract is used in the transaction log Record the event to be published and the event identifier of the event to be published;
    所述区块链系统将所述待发布事件的事件标识发送至所述发布服务器,并将所述待发布事件的事件标识及所述发布标识对应存储至所述去重合约指示的存储空间中。The blockchain system sends the event identifier of the event to be published to the publishing server, and stores the event identifier of the event to be published and the release identifier in the storage space indicated by the deduplication contract. .
  3. 如权利要求2所述的方法,其特征在于,所述去重合约设置有最大存储时长;The method of claim 2, wherein the deduplication contract is set with a maximum storage duration;
    所述方法还包括:The method also includes:
    所述区块链系统从所述去重合约指示的存储空间中删除到达最大存储时长的发布标识与事件标识的对应关系。The blockchain system deletes the correspondence relationship between the release identifier and the event identifier that reaches the maximum storage duration from the storage space indicated by the deduplication contract.
  4. 如权利要求2所述的方法,其特征在于,所述区块链系统包括多个存储空间;The method of claim 2, wherein the blockchain system includes multiple storage spaces;
    所述区块链系统将所述待发布事件的事件标识及所述发布标识对应存储至所述去重合约指示的存储空间中,包括:The block chain system correspondingly storing the event identifier of the event to be released and the release identifier in the storage space indicated by the deduplication contract includes:
    所述区块链系统根据所述待发布事件的发布标识,从所述多个存储空间中确定出所述去重合约指示的存储空间;将所述待发布事件的事件标识及所 述发布标识对应存储至所述去重合约指示的存储空间中。The blockchain system determines the storage space indicated by the deduplication contract from the plurality of storage spaces according to the release identifier of the event to be published; the event identifier of the event to be released and the release identifier Correspondingly stored in the storage space indicated by the deduplication contract.
  5. 如权利要求1至4任一项所述的方法,其特征在于,所述区块链系统调用去重合约,包括:The method according to any one of claims 1 to 4, wherein the blockchain system calling a deduplication contract comprises:
    所述区块链系统调用所述待发布事件所属主题的主题合约,通过所述待发布事件所属主题的主题合约调用所述去重合约。The blockchain system calls the theme contract of the theme to which the event to be published belongs, and calls the deduplication contract through the theme contract of the theme to which the event to be published belongs.
  6. 一种区块链事件去重方法,其特征在于,包括:A method for deduplication of blockchain events, which is characterized in that it includes:
    发布服务器向区块链系统发送部署请求;所述部署请求用于在区块链系统部署去重合约;所述去重合约用于确定所述区块链系统中是否存储有待发布事件的发布标识对应的事件标识;所述事件标识用于唯一标识已发布事件;The publishing server sends a deployment request to the blockchain system; the deployment request is used to deploy a deduplication contract in the blockchain system; the deduplication contract is used to determine whether the blockchain system stores the release identifier of the event to be published Corresponding event identifier; the event identifier is used to uniquely identify the published event;
    所述发布服务器接收部署响应,所述部署响应用于指示所述去重合约部署成功。The publishing server receives a deployment response, where the deployment response is used to indicate that the deduplication contract is successfully deployed.
  7. 一种区块链事件去重装置,其特征在于,包括:A block chain event de-duplication device is characterized in that it comprises:
    收发单元,用于接收发布服务器发送的交易请求;所述交易请求用于请求发布事件;所述交易请求包括待发布事件的发布标识;The transceiver unit is configured to receive a transaction request sent by the publishing server; the transaction request is used to request the publication of the event; the transaction request includes the publication identification of the event to be published;
    处理单元,用于调用去重合约,确定区块链系统中是否存储有所述发布标识对应的事件标识;所述事件标识用于唯一标识已发布事件;The processing unit is used to call the deduplication contract to determine whether the event identifier corresponding to the release identifier is stored in the blockchain system; the event identifier is used to uniquely identify the published event;
    所述处理单元,还用于若确定所述区块链系统中存储有所述发布标识对应的事件标识,则控制所述收发单元将所述发布标识对应的事件标识发送至所述发布服务器。The processing unit is further configured to, if it is determined that the event identifier corresponding to the release identifier is stored in the blockchain system, control the transceiver unit to send the event identifier corresponding to the release identifier to the publishing server.
  8. 如权利要求7所述的装置,其特征在于,所述处理单元,还用于:The device according to claim 7, wherein the processing unit is further configured to:
    若确定所述区块链系统中未存储有所述发布标识对应的事件标识,则调用所述待发布事件所属主题的主题合约;所述主题合约用于在交易日志中记录所述待发布事件及所述待发布事件的事件标识;If it is determined that the event identifier corresponding to the release identifier is not stored in the blockchain system, call the theme contract of the theme to which the event to be published belongs; the theme contract is used to record the event to be published in the transaction log And the event identifier of the event to be released;
    控制所述收发单元将所述待发布事件的事件标识发送至所述发布服务器,并将所述待发布事件的事件标识及所述发布标识对应存储至所述去重合约指示的存储空间中。Control the transceiver unit to send the event identifier of the event to be published to the publishing server, and correspondingly store the event identifier of the event to be published and the release identifier in the storage space indicated by the deduplication contract.
  9. 如权利要求8所述的装置,其特征在于,所述去重合约设置有最大存 储时长;The device according to claim 8, wherein the deduplication contract is set with a maximum storage duration;
    所述处理单元,还用于:The processing unit is also used for:
    从所述去重合约指示的存储空间中删除到达最大存储时长的发布标识与事件标识的对应关系。The correspondence relationship between the release identifier and the event identifier that reaches the maximum storage duration is deleted from the storage space indicated by the deduplication contract.
  10. 如权利要求8所述的装置,其特征在于,所述区块链系统包括多个存储空间;The device according to claim 8, wherein the blockchain system includes multiple storage spaces;
    所述处理单元,具体用于:The processing unit is specifically used for:
    根据所述待发布事件的发布标识,从所述多个存储空间中确定出所述去重合约指示的存储空间;将所述待发布事件的事件标识及所述发布标识对应存储至所述去重合约指示存储空间中。According to the release identifier of the event to be released, the storage space indicated by the deduplication contract is determined from the multiple storage spaces; the event identifier of the event to be released and the release identifier are correspondingly stored in the destination Re-contract indicates in the storage space.
  11. 如权利要求7至10任一项所述的装置,其特征在于,所述处理单元具体用于:The device according to any one of claims 7 to 10, wherein the processing unit is specifically configured to:
    调用所述待发布事件所属主题的主题合约,通过所述待发布事件所属主题的主题合约调用所述去重合约。Call the theme contract of the theme to which the event to be published belongs, and call the deduplication contract through the theme contract of the theme to which the event to be published belongs.
  12. 一种区块链事件去重装置,其特征在于,包括:A block chain event de-duplication device is characterized in that it comprises:
    发送单元,用于向区块链系统发送部署请求;所述部署请求用于在区块链系统部署去重合约;所述去重合约用于确定所述区块链系统中是否存储有待发布事件的发布标识对应的事件标识;所述事件标识用于唯一标识已发布事件;The sending unit is used to send a deployment request to the blockchain system; the deployment request is used to deploy a deduplication contract in the blockchain system; the deduplication contract is used to determine whether there are events to be published in the blockchain system The event identifier corresponding to the release identifier of, the event identifier is used to uniquely identify the published event;
    接收单元,用于接收部署响应,所述部署响应用于指示所述去重合约部署成功。The receiving unit is configured to receive a deployment response, where the deployment response is used to indicate that the deduplication contract is successfully deployed.
  13. 一种计算机设备,其特征在于,包括:A computer device, characterized in that it comprises:
    存储器,用于存储程序指令;Memory, used to store program instructions;
    处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行权利要求1至6任一项所述的方法。The processor is configured to call the program instructions stored in the memory, and execute the method according to any one of claims 1 to 6 according to the obtained program.
  14. 一种计算机可读非易失性存储介质,其特征在于,包括计算机可读指令,当计算机读取并执行所述计算机可读指令时,使得计算机执行如权利 要求1至6任一项所述的方法。A computer-readable non-volatile storage medium, characterized by comprising computer-readable instructions, when the computer reads and executes the computer-readable instructions, the computer is caused to execute any one of claims 1 to 6 Methods.
  15. 一种计算机程序产品,其特征在于,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行权利要求1~6任一所述方法。A computer program product, characterized in that, the computer program product includes a calculation program stored on a non-transitory computer-readable storage medium, the computer program includes program instructions, and when the program instructions are executed by a computer, The computer executes the method described in any one of claims 1 to 6.
PCT/CN2020/084282 2019-04-26 2020-04-10 Blockchain event deduplication method and apparatus, and computer device and storage medium WO2020216077A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910342419.8 2019-04-26
CN201910342419.8A CN110099108B (en) 2019-04-26 2019-04-26 Block chain event duplicate removal method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2020216077A1 true WO2020216077A1 (en) 2020-10-29

Family

ID=67445904

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/084282 WO2020216077A1 (en) 2019-04-26 2020-04-10 Blockchain event deduplication method and apparatus, and computer device and storage medium

Country Status (2)

Country Link
CN (1) CN110099108B (en)
WO (1) WO2020216077A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114363162A (en) * 2021-12-31 2022-04-15 支付宝(杭州)信息技术有限公司 Block chain log generation method and device, electronic equipment and storage medium

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110099108B (en) * 2019-04-26 2022-04-01 深圳前海微众银行股份有限公司 Block chain event duplicate removal method and device, computer equipment and storage medium
CN110471933B (en) * 2019-08-16 2024-03-26 腾讯科技(深圳)有限公司 Information processing method, device, computer equipment and storage medium
CN111275553B (en) * 2020-01-20 2023-08-11 联动优势科技有限公司 Block chain data storage method and block chain system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170134161A1 (en) * 2015-11-06 2017-05-11 Cable Television Laboratories, Inc Blockchaining for media distribution
CN107295002A (en) * 2017-07-12 2017-10-24 联动优势科技有限公司 The method and server of a kind of high in the clouds data storage
CN107301536A (en) * 2017-06-12 2017-10-27 腾讯科技(深圳)有限公司 Resource transfers method and device
CN108805569A (en) * 2018-05-29 2018-11-13 阿里巴巴集团控股有限公司 Transaction processing method and device, electronic equipment based on block chain
CN108846752A (en) * 2018-06-06 2018-11-20 北京京东金融科技控股有限公司 Data processing method, system, block platform chain and readable storage medium storing program for executing
CN110099108A (en) * 2019-04-26 2019-08-06 深圳前海微众银行股份有限公司 A kind of block chain event De-weight method, device, computer equipment and storage medium

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101780636B1 (en) * 2016-05-16 2017-09-21 주식회사 코인플러그 Method for issuing certificate information and blockchain-based server using the same
WO2018144302A1 (en) * 2017-01-31 2018-08-09 Rush Thomas Jay Blockchain data-processing engine
CN107395557B (en) * 2017-03-28 2020-05-15 创新先进技术有限公司 Service request processing method and device
US10839379B2 (en) * 2017-07-20 2020-11-17 Chicago Mercantile Exchange Inc. Blockchain including linked digital assets
CN107464117B (en) * 2017-08-04 2021-06-22 平安科技(深圳)有限公司 Block chain based data management method and block chain system
CN108062671A (en) * 2017-11-03 2018-05-22 深圳市轱辘车联数据技术有限公司 Data trade method, block chain node server and data submit terminal
CN108573741A (en) * 2017-12-25 2018-09-25 北京金山云网络技术有限公司 Business datum recording method, device, equipment and storage medium
CN108614878B (en) * 2018-04-27 2023-01-10 腾讯科技(深圳)有限公司 Protocol data management method, device, storage medium and system
CN108769751B (en) * 2018-05-02 2020-09-08 中广热点云科技有限公司 Network audio-visual management support system based on intelligent contract
CN108681572B (en) * 2018-05-04 2020-12-29 蔷薇大树科技有限公司 Data storage method and device of block chain and electronic equipment
CN108647974A (en) * 2018-05-11 2018-10-12 北京奇虎科技有限公司 A kind of Information Authentication method, apparatus and system based on block chain
CN108961052B (en) * 2018-06-25 2022-02-22 百度在线网络技术(北京)有限公司 Verification method, storage method, device, equipment and medium of block chain data
CN113283905A (en) * 2018-10-26 2021-08-20 创新先进技术有限公司 Data storage and acquisition method and device based on block chain

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170134161A1 (en) * 2015-11-06 2017-05-11 Cable Television Laboratories, Inc Blockchaining for media distribution
CN107301536A (en) * 2017-06-12 2017-10-27 腾讯科技(深圳)有限公司 Resource transfers method and device
CN107295002A (en) * 2017-07-12 2017-10-24 联动优势科技有限公司 The method and server of a kind of high in the clouds data storage
CN108805569A (en) * 2018-05-29 2018-11-13 阿里巴巴集团控股有限公司 Transaction processing method and device, electronic equipment based on block chain
CN108846752A (en) * 2018-06-06 2018-11-20 北京京东金融科技控股有限公司 Data processing method, system, block platform chain and readable storage medium storing program for executing
CN110099108A (en) * 2019-04-26 2019-08-06 深圳前海微众银行股份有限公司 A kind of block chain event De-weight method, device, computer equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114363162A (en) * 2021-12-31 2022-04-15 支付宝(杭州)信息技术有限公司 Block chain log generation method and device, electronic equipment and storage medium
CN114363162B (en) * 2021-12-31 2024-05-03 支付宝(杭州)信息技术有限公司 Block chain log generation method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN110099108A (en) 2019-08-06
CN110099108B (en) 2022-04-01

Similar Documents

Publication Publication Date Title
WO2020216077A1 (en) Blockchain event deduplication method and apparatus, and computer device and storage medium
CN110825420B (en) Method, device, equipment and storage medium for updating configuration parameters of distributed cluster
CN110083629B (en) Event subscription method and device based on blockchain
US20230074102A1 (en) Method and apparatus for processing data based on block chain, device and readable storage medium
US9372879B1 (en) Balanced append tree data structure
WO2021082340A1 (en) Data processing method, apparatus, system, and storage medium
US20210271648A1 (en) Data migration methods and system
WO2020211622A1 (en) Blockchain-based message storage method and device
WO2023011022A1 (en) Blockchain-based data processing method, and device and computer-readable storage medium
CN111478828A (en) Pressure testing method, device and system for block chain network
WO2020238250A1 (en) Capital chain information tracing method and system, and server and readable storage medium
TW202008763A (en) Data processing method and apparatus, and client
CN110704438A (en) Method and device for generating bloom filter in block chain
WO2022247316A1 (en) Storage object processing system, request processing method, gateway, and storage medium
CN109145053B (en) Data processing method and device, client and server
CN108512930B (en) Shared file management method, device, server and storage medium
US20200394085A1 (en) Smart contract information redirect to updated version of smart contract
CN106339176B (en) Intermediate file processing method, client, server and system
WO2021129005A1 (en) Blockchain state change-based transaction tracking method and device
US11120513B2 (en) Capital chain information traceability method, system, server and readable storage medium
WO2018188607A1 (en) Stream processing method and device
US9578120B1 (en) Messaging with key-value persistence
US20120102168A1 (en) Communication And Coordination Between Web Services In A Cloud-Based Computing Environment
KR102031589B1 (en) Methods and systems for processing relationship chains, and storage media
CN109684051B (en) Method and system for asynchronously submitting hybrid big data task

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: 20796059

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 18/02/2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20796059

Country of ref document: EP

Kind code of ref document: A1