CN109542980B - Data processing method, device, equipment and medium for block chain - Google Patents

Data processing method, device, equipment and medium for block chain Download PDF

Info

Publication number
CN109542980B
CN109542980B CN201811383708.4A CN201811383708A CN109542980B CN 109542980 B CN109542980 B CN 109542980B CN 201811383708 A CN201811383708 A CN 201811383708A CN 109542980 B CN109542980 B CN 109542980B
Authority
CN
China
Prior art keywords
block
data
request
timestamp
block chain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811383708.4A
Other languages
Chinese (zh)
Other versions
CN109542980A (en
Inventor
张人杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Magcloud Digital Technology Co ltd
Original Assignee
Beijing Magcloud Digital Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Magcloud Digital Technology Co ltd filed Critical Beijing Magcloud Digital Technology Co ltd
Priority to CN201811383708.4A priority Critical patent/CN109542980B/en
Publication of CN109542980A publication Critical patent/CN109542980A/en
Application granted granted Critical
Publication of CN109542980B publication Critical patent/CN109542980B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The embodiment of the invention discloses a data processing method, a data processing device, data processing equipment and a data processing medium for a block chain. The method is applied to the block chain node and comprises the following steps: if the local node is in a downtime event, acquiring a creating timestamp of the last block from the local block chain; sending a block data synchronization request carrying the creation timestamp to a block chain network to request other nodes to feed back the creation timestamp to block data in the current timestamp; and carrying out local block synchronization according to the block data fed back by other nodes. According to the technical scheme of the embodiment of the invention, the data is stored in the block chain, so that the data is not easy to be tampered and lost, the safety of the data is improved, and when any node in the block chain loses the data, the data can be acquired from the block chain in real time for synchronization.

Description

Data processing method, device, equipment and medium for block chain
Technical Field
Embodiments of the present invention relate to a block chain technology, and in particular, to a method, an apparatus, a device, and a medium for processing data of a block chain.
Background
At present, most business systems store data based on a database, so that when a core database is down and disaster recovery is insufficient, business data are difficult to restore, and even if the database can be restored, a small amount of business data are lost. In addition, in a Database storage-based system, a DBA (Database Administrator) plays a very important role, and data can be modified or forged, so that data loss may be caused by a maloperation of the DBA, and an operation history is not traceable, thereby making data restoration very difficult.
Disclosure of Invention
Embodiments of the present invention provide a data processing method, an apparatus, a device, and a medium for a block chain, which enable data to be less prone to being tampered and lost by storing the data in the block chain, improve the security of the data, and enable any node in the block chain to obtain the data from the block chain in real time for synchronization when the data is lost.
In a first aspect, an embodiment of the present invention further provides a data processing method for a block chain, which is applied to a block chain node, and includes:
if the local node is in a downtime event, acquiring a creating timestamp of the last block from the local block chain;
sending a block data synchronization request carrying the creation timestamp to a block chain network to request other nodes to feed back the creation timestamp to block data in the current timestamp;
and carrying out local block synchronization according to the block data fed back by other nodes.
In a second aspect, an embodiment of the present invention further provides a data processing apparatus for a blockchain, where the data processing apparatus is configured in a blockchain node, and the apparatus includes:
creating a timestamp acquisition request, which is used for acquiring the creation timestamp of the last block from the local block chain if a down event occurs to the local node;
a synchronization request sending module, configured to send a block data synchronization request carrying the creation timestamp to a block chain network, so as to request other nodes to feed back the creation timestamp to block data in a current timestamp;
and the block synchronization module is used for carrying out local block synchronization according to the block data fed back by other nodes.
In a third aspect, an embodiment of the present invention further provides an apparatus, where the apparatus includes:
one or more processors;
storage means for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement the method for data processing of a blockchain according to any of the first aspects.
In a fourth aspect, an embodiment of the present invention further provides a medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the data processing method of the blockchain according to any of the first aspects.
According to the data processing method, device, equipment and medium for the block chain provided by the embodiment of the invention, when a down event occurs in a local node, the creating timestamp of the last block can be acquired from the local block chain of the local node, and then a block data synchronization request carrying the creating timestamp is sent to a block chain network to request other nodes to feed back the block data from the creating timestamp to the current timestamp, so that local block synchronization is performed according to the block data. Compared with the existing business system for storing data based on a database, the scheme has the advantages that the data are stored in the block chain, so that the data are not easy to be distorted and lost, and the safety of the data is improved; and when any node in the block chain loses data, the data can be acquired from the block chain in real time for synchronization, and a new implementation mode is provided for data restoration.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a system structure diagram of an apparatus for carrying a blockchain node according to an embodiment of the present invention;
fig. 2 is a flowchart of a data processing method for a block chain according to an embodiment of the present invention;
fig. 3 is a flowchart of a data processing method of a block chain according to a second embodiment of the present invention;
fig. 4 is a schematic structural diagram of a data processing apparatus of a block chain according to a third embodiment of the present invention;
fig. 5 is a schematic structural diagram of an apparatus provided in the fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Before describing the embodiments of the present invention, an application scenario of the embodiments of the present invention is described. Referring to fig. 1, a system structure diagram of a device for bearing a block chain node according to an embodiment of the present invention adopts a technical architecture combining Spring Boot and Dubbo, and the system sequentially includes, in a layered structure: the Web display layer, the Spring Boot background container and the data storage layer. The Web front end is realized by adopting H5 page and front end technologies such as javascript, jQuery, require and the like. The Spring Boot background container is divided into a Web Json interface layer, a service layer and a dao layer. Wherein, the Web Json interface layer is realized by using a Spring Boot Controller; the service layer realizes a micro-service architecture through Dubbo and realizes management of transaction operation at a service provider; the dao layer operates on the blockchain data through the Java transit Go language layer. The data storage can provide a storage function of business data and super account book service of bill service, and the like, and the storage and the safety of the data are realized by adopting a block chain bottom layer technology. The embodiment of the invention constructs a multi-data node block chain based on a block chain bottom layer technology, and a consensus mechanism including a synchronization mechanism is configured among the block chain nodes, so that the nodes can communicate with each other, such as operations of data storage, query, synchronization and the like. The technical scheme of the embodiment of the invention is introduced based on the above.
Example one
Fig. 2 is a flowchart of a data processing method of a block chain according to an embodiment of the present invention, which is based on a block chain technology to process data, such as storage, query, and synchronization, so as to solve the problems of low reliability and difficult restoration of the existing service data. The applicable blockchain may be a public chain, a private chain, or a federation chain. The scheme of the embodiment of the invention is applied to the blockchain node, and the method can be executed by a data processing device of the blockchain, and the device can be realized in a software and/or hardware mode and can be integrated in a computing device for bearing the blockchain node. Referring to fig. 2, the method specifically includes:
and S210, if the local node is down, acquiring the creating timestamp of the last block from the local block chain.
In this embodiment, the downtime event refers to a phenomenon that a local node cannot normally operate due to an unexpected fault, such as a crash. The creation timestamp refers to the creation time of the last block in the local blockchain of the native node. Alternatively, the native node may obtain the creation timestamp from the chunk header of the last chunk.
Specifically, if a downtime event occurs to a local node, the last block of the local block chain may be located after the downtime is restarted, and then a timestamp of the last block is obtained from a block header of the block and used as a creation timestamp.
S220, sending a block data synchronization request carrying the creation timestamp to the blockchain network, so as to request other nodes to feed back the creation timestamp to the block data in the current timestamp.
In this embodiment, the block data synchronization request refers to a requirement generated when a node in a block chain needs to perform block data synchronization, and the optional block data synchronization request may include a creation timestamp and a node identifier. The node identifier is a mark for uniquely identifying or authenticating the identity of a certain node, and may be a node ID or an IP network address.
The other nodes may be the current block generation node or other block chain nodes. The current timestamp may be the creation time of the last block in the block chain of the other node itself; alternatively, the current timestamps may be different for different nodes. If the other nodes are current block generation nodes, the current timestamp may be the time of the block newly created by the current block generation node in the block chain network; if the other node is another block chain node, the current timestamp may be the same as the timestamp of the current block generation node, or may be the creation time of the penultimate block in the block chain of the current block generation node, or: and if the number of the nodes with the same number of the storage blocks in the block chain network exceeds half of the total number of the nodes in the block chain network, the creation time of the last block in the block chain of any node with the same number of the storage blocks in the block chain network is the current timestamp.
Specifically, the local node may send a block data synchronization request carrying a creation timestamp to the block chain network; after receiving the block data synchronization request, other nodes in the block chain network acquiesce and acquire all block data from the creation timestamp to the current timestamp from the block chain of the other nodes according to the creation timestamp based on a consensus mechanism, and feed back all the block data to the local node.
In addition, the local node can also directly send a block data synchronization request carrying the creation timestamp and the current timestamp to the block chain network. For example, sending a chunk data synchronization request carrying a creation timestamp to a chunk chain network to request other nodes to feed back the creation timestamp to the chunk data in the current timestamp may include: sending a current timestamp acquisition request to a current block generation node; and receiving a current timestamp fed back by the current block generation node, adding the current timestamp and the creation timestamp into the block data synchronization request, and sending the block data synchronization request to the block chain network to request other nodes to feed back the block data with the creation timestamp to the current timestamp.
In this embodiment, the current timestamp obtaining request is used to request the current block generation node to obtain a timestamp from the last block of its own block chain or the block header of the newly created block, and perform feedback. Specifically, after receiving a current timestamp fed back by a current block generation node, a local node may add the current timestamp and a creation timestamp to a block data synchronization request; the block data synchronization request can be directly sent to the current block generation node to request the current block generation node to feed back the creation timestamp to the block data in the current timestamp. In order to relieve the stress of the current block generation node, the block data synchronization request can also be sent to other block chain nodes.
For example, sending a chunk data synchronization request carrying the creation timestamp to the blockchain network to request other nodes to feed back the creation timestamp to the chunk data in the current timestamp may further include: sending a local timestamp acquisition request to other nodes; receiving local timestamps fed back by other nodes, and selecting the latest timestamp from all the local timestamps as a current timestamp; and adding the current time stamp and the creation time stamp into the block data synchronization request, and sending the block data synchronization request to the block chain network to request other nodes to feed back the creation time stamp to the block data in the current time stamp. In this embodiment, the local timestamp obtaining request is used to request other nodes to obtain a timestamp from a block header of a last block of the block chain of the other nodes, and perform feedback.
S230, local block synchronization is performed according to the block data fed back by other nodes.
If the block data synchronization request does not include the current timestamp, the specific operation process of the local node for local block synchronization according to the block data fed back by other nodes may be as follows: after receiving the block data fed back by other nodes, the local node can store the block data fed back by each node in a preset storage area; then, for each block data, acquiring a current time stamp from the last block of the block data; if the current timestamps are the same, any block data can be acquired from the storage area and linked to the last block of the local block chain, so that local block synchronization is completed, and the block data stored in the storage area can be cleared. If the number of the same current timestamps in each current timestamp exceeds half of the current timestamp acquired by the local node, and the time of the same current timestamp is latest, block data corresponding to one same timestamp can be randomly acquired from the storage area to perform local block synchronization. If the number of the same current timestamps in each current timestamp exceeds half of the current timestamp acquired by the local node, and the same current timestamps are located behind the current timestamp corresponding to the latest time, it is indicated that the current timestamp corresponding to the latest time is the creation time of the last block in the block data sent by the current block generation node, and the block is not verified by other nodes; therefore, the local node can firstly verify the last block in the block data fed back by the current block generation node, and if the verification is passed, the local node can directly acquire the block data fed back by the current block generation node from the storage area to perform local block synchronization; if the verification fails, the block data corresponding to the same timestamp can be randomly acquired for local block synchronization.
If the block data synchronization request includes the current timestamp, the specific operation process of the local node performing local block synchronization according to the block data fed back by other nodes may be: if only the block data sent by the current block generation node is received, it indicates that the current timestamp is the creation time of the last block in the block data sent by the current block generation node, and the block is not verified by other nodes; at this time, the local node needs to verify the last block in the block data, and if the verification is passed, all block data fed back by the current block generation node are stored; if the verification fails, the last block is discarded, and the remaining blocks are stored to complete local block synchronization. If the local node receives at least two block data, the block data in the block data is verified, so that the block data of any node can be directly acquired for local storage, and local block synchronization is further completed.
For example, after performing local block synchronization according to block data fed back by other nodes, the method may further include: and sending the local block synchronization success information to the block chain network, so that the node which does not send the block data to the local node does not carry out sending operation.
According to the technical scheme provided by the embodiment of the invention, when a local node is in a downtime event, the creating timestamp of the last block can be acquired from the local block chain of the local node, and then a block data synchronization request carrying the creating timestamp is sent to a block chain network to request other nodes to feed back the creating timestamp to block data within the current timestamp, so that local block synchronization is carried out according to the block data. Compared with the existing business system for storing data based on a database, the scheme stores the data in the block chain, so that the data is not easy to be distorted and lost, and the safety of the data is improved; and when any node in the block chain loses data, the data can be acquired from the block chain in real time for synchronization, and a new implementation mode is provided for data restoration.
Example two
Fig. 3 is a flowchart of a data processing method of a block chain according to a second embodiment of the present invention, which is further optimized based on the foregoing description and provides a scheme for storing and querying data. Referring to fig. 3, the method specifically includes:
and S310, if the local node is down, acquiring the creating timestamp of the last block from the local block chain.
S320, sending a block data synchronization request carrying the creation timestamp to the blockchain network, so as to request other nodes to feed back the creation timestamp to the block data in the current timestamp.
S330, local block synchronization is performed according to the block data fed back by other nodes.
S340, obtain the uplink transaction request including the ticket transaction.
In this embodiment, the ticket transaction may include account number data and transaction data; account data may include, but is not limited to, account name, account ID, identification number, banking information such as bank account number and remarks, etc.; transaction data may include, but is not limited to, account names, account IDs, identification numbers, amount transfer information, and buy and sell item information for both parties to the transaction. Alternatively, the account number data and transaction data may be stored in bitcoin form, i.e. in the form of fields.
The uplink transaction request is used for requesting the local node to process the bill transaction and storing the request in the block chain. Specifically, the local node can receive uplink requests including bill transactions sent by other nodes; the uplink transaction request including the ticket transaction may also be obtained locally.
S350, the uplink transaction request is processed to obtain the index relation between the bill account identification of the bill transaction and the record information of the bill account.
In this embodiment, the bill account identifier refers to an identity identifier for uniquely identifying an account shown on a bill, and may be, for example, an account ID, a user name, an identification number, or the like; the record information of the bill account refers to descriptive information associated with the bill account, and illustratively, the content of the record information of the bill account is different for different types of bill transactions. If the bill transaction is account data, the record information of the bill account can comprise account opening information, a bank account, a real name, the current account amount or remarks of the account and the like; if the bill transaction is transaction data, the record information of the bill account may include account amount inflow or outflow information, and purchase or sell item information, etc.
To facilitate querying, the present embodiment stores transaction data in the form of an index relationship or an index pair (Key-Value); in this embodiment, the index relationship refers to an association relationship between a ticket account identifier (Key) and record information (Value) of a ticket account.
Specifically, if the local node is the current block generation node, after the uplink transaction request including the bill transaction is acquired, the bill transaction in the uplink transaction request can be processed to obtain the index relationship between the bill account identifier of the bill transaction and the record information of the bill account; the index relationship may then be stored as transaction data in the current block of the local blockchain; the current block may then be transmitted to the blockchain network so that other nodes verify and store the current block.
If the local node is another block chain node, after the uplink transaction request including the bill transaction is acquired, the uplink transaction request can be sent to the current block generation node to request the current block generation node to process the uplink transaction request, and the obtained index relationship between the bill account identifier of the bill transaction and the record information of the bill account is stored in the block chain as transaction data.
And S360, storing the index relation as transaction data in the block chain.
S370, a link inquiry request including the target bill account identification is received.
In this embodiment, the on-chain query request may be a request sent by a user to a block link point through a data interaction platform (such as a client interface or a web page) provided by the block link node, and used for requesting the block link node to query the required data in the local block chain; but also requests sent by other nodes. Optionally, the on-chain query request may include a target billing account identification, a user identification, a node identification, or the like. The user identifier is a mark for uniquely identifying the user identity, and can be a user ID; the target billing account identification may be an account ID of some account history information that the user is looking up.
Specifically, the local node may receive an on-chain query request including the target account identifier sent by a user through a data interaction platform (such as a client interface or a web page) provided by the blockchain node, and may also receive an on-chain query request including the target account identifier sent by another node.
And S380, searching and acquiring the index relation corresponding to the target bill account identification from the block chain according to the target bill account identification in the query request on the chain.
Specifically, the local node may search and obtain all index relationships corresponding to the target account identifier of the bill in the local block chain by traversing from the current block forward according to the target account identifier in the query request on the chain.
If the local node receives the on-chain query request after the downtime is restarted, or the local node itself is a lightweight node which does not store the block chain, the on-chain query request including the target bill account identifier may be transmitted to the current block generating node, so as to request the current block generating node to search and obtain all index relationships corresponding to the target bill account identifier in the block chain itself, and the index relationships are fed back to the local node.
And S390, feeding back the searched index relation to the initiator of the query request.
Specifically, after obtaining all the index relationships corresponding to the target bill account identifier, the local node may feed back the index relationships to the initiator of the query request, so that the initiator of the query request can view history changes of the record information of the bill account associated with the target bill account identifier according to the index relationships. For example, the account ID is checked for the case where the amount of money flows into or out of the account or the case where the account opening information changes.
It should be noted that, in this embodiment, there is no difference between the operation process of performing block data synchronization (steps S310 to S330), the operation process of performing data storage (steps S340 to S360), and the query operation process (steps S370 to S390). In addition, the operations of steps S340 to S390 may also be independently performed.
According to the technical scheme provided by the embodiment of the invention, when a local node is in a downtime event, the creating timestamp of the last block can be acquired from the local block chain of the local node, and then a block data synchronization request carrying the creating timestamp is sent to a block chain network to request other nodes to feed back the creating timestamp to block data within the current timestamp, so that local block synchronization is carried out according to the block data. In addition, the ticket transaction is processed into an index relation form of the ticket account identification of the ticket transaction and the record information of the ticket account, and the index relation is stored in the block chain as transaction data, so that traversal is provided for subsequent query verification. Compared with the existing business system for storing data based on a database, the scheme stores the data in the block chain, so that the data is not easy to be distorted and lost, and the safety of the data is improved; and when any node in the block chain loses data, the data can be acquired from the block chain in real time for synchronization, and a new implementation mode is provided for data restoration.
EXAMPLE III
Fig. 4 is a schematic structural diagram of a data processing apparatus of a block chain according to a third embodiment of the present invention, where the apparatus may be configured in a block chain node, and may execute a data processing method of a block chain according to any embodiment of the present invention, and the apparatus has functional modules and beneficial effects corresponding to the execution method. As shown in fig. 4, the apparatus includes:
a creating timestamp acquiring request 410, configured to acquire a creating timestamp of a last block from a local block chain if a local node generates a downtime event;
a synchronization request sending module 420, configured to send a block data synchronization request carrying a creation timestamp to a block chain network, so as to request other nodes to feed back the creation timestamp to block data in a current timestamp;
the block synchronization module 430 is configured to perform local block synchronization according to block data fed back by other nodes.
According to the technical scheme provided by the embodiment of the invention, when a local node is in a downtime event, the creating timestamp of the last block can be acquired from the local block chain of the local node, and then a block data synchronization request carrying the creating timestamp is sent to a block chain network to request other nodes to feed back the creating timestamp to block data within the current timestamp, so that local block synchronization is carried out according to the block data. Compared with the existing business system for storing data based on a database, the scheme stores the data in the block chain, so that the data is not easy to be distorted and lost, and the safety of the data is improved; and when any node in the block chain loses data, the data can be acquired from the block chain in real time for synchronization, and a new implementation mode is provided for data restoration.
Illustratively, the apparatus may further include:
the business request receiving module is used for acquiring an uplink business request comprising a bill business;
the transaction request processing module is used for processing the uplink transaction request to obtain the index relationship between the bill account identifier of the bill transaction and the record information of the bill account;
and the storage module is used for storing the index relation as transaction data in the block chain.
Illustratively, the ticket transaction may include account number data and transaction data.
Illustratively, the synchronization request sending module 420 may be specifically configured to:
sending a current timestamp acquisition request to a current block generation node;
and receiving a current timestamp fed back by the current block generation node, adding the current timestamp and the creation timestamp into the block data synchronization request, and sending the block data synchronization request to the block chain network to request other nodes to feed back the block data with the creation timestamp to the current timestamp.
Illustratively, the apparatus may further include:
the query request receiving module is used for receiving an on-chain query request comprising the target bill account identification after the index relation is stored in the blockchain as transaction data;
the index relation searching module is used for searching the index relation corresponding to the target bill account identification from the block chain according to the target bill account identification in the on-chain query request;
and the index relation sending module is used for feeding back the searched index relation to the initiator of the query request.
Example four
Fig. 5 is a schematic structural diagram of an apparatus according to a fourth embodiment of the present invention. Fig. 5 illustrates a block diagram of an exemplary device 12 suitable for use in implementing embodiments of the present invention. The device 12 shown in fig. 5 is only an example and should not bring any limitations to the functionality and scope of use of the embodiments of the present invention. Device 12 is typically a computing device that assumes the functionality of a blockchain network node.
As shown in FIG. 5, device 12 is in the form of a general purpose computing device. The components of device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. Device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, and commonly referred to as a "hard drive"). Although not shown in FIG. 5, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with device 12, and/or with any devices (e.g., network card, modem, etc.) that enable device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 20. As shown, the network adapter 20 communicates with the other modules of the device 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing, such as a data processing method of a block chain provided by an embodiment of the present invention, by executing a program stored in the system memory 28.
EXAMPLE five
Fifth, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, can implement the data processing method of the block chain described in the foregoing embodiment. The computer readable storage medium may be configured on a blockchain node.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (9)

1. A data processing method of a block chain is applied to a block chain node, and comprises the following steps:
if the local node is in a downtime event, acquiring a creating timestamp of the last block from the local block chain;
sending a block data synchronization request carrying the creation timestamp to a block chain network to request other nodes to feed back the creation timestamp to block data in the current timestamp;
the sending a block data synchronization request carrying the creation timestamp to a block chain network to request other nodes to feed back the creation timestamp to block data in a current timestamp includes:
sending a current timestamp acquisition request to a current block generation node;
receiving a current timestamp fed back by the current block generation node, adding the current timestamp and a creation timestamp into a block data synchronization request, and sending the block data synchronization request to a block chain network to request other nodes to feed back block data from the creation timestamp to the current timestamp;
and carrying out local block synchronization according to the block data fed back by other nodes.
2. The method of claim 1, further comprising:
acquiring a uplink transaction request comprising a ticket transaction;
processing the uplink transaction request to obtain an index relationship between the bill account identifier of the bill transaction and the record information of the bill account;
storing the index relationship as transaction data in a blockchain.
3. The method of claim 2, wherein the ticket transaction comprises: account number data and transaction data.
4. The method of claim 2, wherein after storing the index relationship as transactional data in a blockchain, further comprising:
receiving an on-chain query request including a target ticket account identifier;
searching and acquiring an index relation corresponding to the target bill account identification from a block chain according to the target bill account identification in the on-chain query request;
and feeding back the searched index relation to the initiator of the query request.
5. A data processing apparatus of a block chain, configured in a block chain node, comprising:
creating a timestamp acquisition request, which is used for acquiring the creation timestamp of the last block from the local block chain if a down event occurs to the local node;
a synchronization request sending module, configured to send a block data synchronization request carrying the creation timestamp to a block chain network, so as to request other nodes to feed back the creation timestamp to block data in a current timestamp;
the synchronization request sending module is specifically configured to: sending a current timestamp acquisition request to a current block generation node; receiving a current timestamp fed back by a current block generation node, adding the current timestamp and a creation timestamp into a block data synchronization request, and sending the block data synchronization request to a block chain network to request other nodes to feed back block data with the creation timestamp in the current timestamp;
and the block synchronization module is used for carrying out local block synchronization according to the block data fed back by other nodes.
6. The apparatus of claim 5, further comprising:
a transaction request receiving module, configured to receive an uplink transaction request including a ticket transaction;
the transaction request processing module is used for processing the uplink transaction request to obtain an index relationship between the bill account identifier of the bill transaction and the record information of the bill account;
and the storage module is used for storing the index relation as transaction data in a block chain.
7. The apparatus of claim 6, wherein the ticket transaction comprises: account number data and transaction data.
8. A data processing apparatus of a block chain, the apparatus comprising:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a data processing method of a blockchain as recited in any one of claims 1-4.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the data processing method of a block chain according to any one of claims 1 to 4.
CN201811383708.4A 2018-11-20 2018-11-20 Data processing method, device, equipment and medium for block chain Active CN109542980B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811383708.4A CN109542980B (en) 2018-11-20 2018-11-20 Data processing method, device, equipment and medium for block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811383708.4A CN109542980B (en) 2018-11-20 2018-11-20 Data processing method, device, equipment and medium for block chain

Publications (2)

Publication Number Publication Date
CN109542980A CN109542980A (en) 2019-03-29
CN109542980B true CN109542980B (en) 2020-12-18

Family

ID=65848848

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811383708.4A Active CN109542980B (en) 2018-11-20 2018-11-20 Data processing method, device, equipment and medium for block chain

Country Status (1)

Country Link
CN (1) CN109542980B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110309163A (en) * 2019-06-28 2019-10-08 杭州复杂美科技有限公司 Block chain relation type database maintenance method and data query method
CN110609872B (en) * 2019-09-20 2021-03-05 北京海益同展信息科技有限公司 Method and apparatus for synchronizing node data
CN112565104A (en) * 2020-12-01 2021-03-26 腾讯科技(深圳)有限公司 Flow control method, device, medium and electronic equipment of block chain system

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107181599A (en) * 2017-07-18 2017-09-19 天津理工大学 The storage of route location data confidentiality and sharing method based on block chain

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10402792B2 (en) * 2015-08-13 2019-09-03 The Toronto-Dominion Bank Systems and method for tracking enterprise events using hybrid public-private blockchain ledgers
CN107786339A (en) * 2016-08-31 2018-03-09 陈新 It is layered controllable alliance's block catenary system
CN106598490A (en) * 2016-11-25 2017-04-26 深圳前海微众银行股份有限公司 Access method for block chain data and block chain management system
CN107423152B (en) * 2017-04-24 2019-05-21 杭州趣链科技有限公司 A kind of block chain common recognition node automatic recovery method
CN108241743B (en) * 2018-01-04 2020-05-12 杭州复杂美科技有限公司 Block chain snapshot method
CN108614750A (en) * 2018-04-27 2018-10-02 中国联合网络通信集团有限公司 The restoration methods and device of delay machine data

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107181599A (en) * 2017-07-18 2017-09-19 天津理工大学 The storage of route location data confidentiality and sharing method based on block chain

Also Published As

Publication number Publication date
CN109542980A (en) 2019-03-29

Similar Documents

Publication Publication Date Title
CN109542980B (en) Data processing method, device, equipment and medium for block chain
JP6754495B2 (en) Methods and systems for the protection and verification of identities and certificates via the blockchain
US10346394B2 (en) Importation, presentation, and persistent storage of data
EP3438903A1 (en) Hierarchical network system, and node and program used in same
EP3345360A1 (en) Method for storing an object on a plurality of storage nodes
US9350726B2 (en) Recovery from rolling security token loss
US20190286490A1 (en) Event-driven blockchain workflow processing
US8554727B2 (en) Method and system of tiered quiescing
US20190172067A1 (en) Method and system for risk scoring anonymized transactions
US20210049715A1 (en) Blockchain-based data procesing method, apparatus, and electronic device
CN110738471A (en) bill management method based on block chain network and related equipment
US8478744B1 (en) Dynamic query sequences for retrieval of negotiable instrument image
JP6618138B1 (en) Data management system with tamper detection
CN107038617A (en) Pay invoice pre-creates method and device
AU2019381980A1 (en) Taking snapshots of blockchain data
CN110781134A (en) Data processing method and device, computer storage medium and electronic equipment
US20150363414A1 (en) Processing large xml files by splitting and hierarchical ordering
WO2020152893A1 (en) Data management system with falsification detectability
US20190115095A1 (en) Methods for more accurately managing processing of medical bill data and devices thereof
CN111274255B (en) Service data monitoring method and system, monitoring architecture, equipment and storage medium
KR20200091098A (en) Method for managing a trascation ledger of finalcial institution by maintaining a backup ledger within a blockchain network
US10795882B2 (en) Blockchain-based data compression and searching
EP3503011A1 (en) Data analytics engine
US20200274899A1 (en) Preventing Unauthorized Access to Information Resources by Deploying and Utilizing Multi-Path Data Relay Systems and Sectional Transmission Techniques
KR20200012686A (en) Apparatus and Method for KYC using KYC blockchain

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant