CN112070613B - Transaction data storage method, device, block chain system and storage medium - Google Patents

Transaction data storage method, device, block chain system and storage medium Download PDF

Info

Publication number
CN112070613B
CN112070613B CN202011250290.7A CN202011250290A CN112070613B CN 112070613 B CN112070613 B CN 112070613B CN 202011250290 A CN202011250290 A CN 202011250290A CN 112070613 B CN112070613 B CN 112070613B
Authority
CN
China
Prior art keywords
transaction
node
transaction data
data
processed
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
CN202011250290.7A
Other languages
Chinese (zh)
Other versions
CN112070613A (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.)
Rootcloud Technology Co Ltd
Original Assignee
Irootech 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 Irootech Technology Co ltd filed Critical Irootech Technology Co ltd
Priority to CN202011250290.7A priority Critical patent/CN112070613B/en
Publication of CN112070613A publication Critical patent/CN112070613A/en
Application granted granted Critical
Publication of CN112070613B publication Critical patent/CN112070613B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The transaction data storage method, the transaction data storage device, the blockchain system and the storage medium provided by the embodiment of the application are applied to the blockchain system comprising a plurality of transaction nodes, and each transaction node comprises a plurality of transaction data arranged according to a time sequence. For any transaction node in the blockchain system, the hash value of the transaction data of the node in a time period and the hash value of the transaction data of other transaction nodes in the same time period are calculated in a combined mode, so that the transaction node comprises the transaction data of the transaction node and the transaction data of other transaction nodes, and the transaction data of a single transaction node can be prevented from being tampered. In addition, each transaction node of the application only carries out Hash calculation at a certain time node, global sequencing is not needed, the required network overhead is reduced, and the single-point fault risk caused by sequencing by only using one sequencing node is eliminated.

Description

Transaction data storage method, device, block chain system and storage medium
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a transaction data storage method, apparatus, blockchain system, and storage medium.
Background
Nowadays, the development of the blockchain technology is faster and faster, the blockchain technology is also rapidly applied to various fields, a large amount of transaction data needs to be stored in a block when transaction records, product traceability and the like are realized based on the blockchain, and in order to ensure that the transaction data is not tampered, the hash value of the transaction data needs to be stored through the storage block of the blockchain.
At present, in a conventional blockchain system, transaction data generated by each transaction node in the blockchain system is uniformly sorted and packed by a sorting service node in the blockchain system to form a block in the blockchain system and distributed to each transaction node.
The sequencing and packaging of all transaction data by one sequencing service node can cause large network flow during sequencing, and influence the system performance, and in addition, if the sequencing service node fails, the whole block chain system cannot be normally used.
Disclosure of Invention
In view of the above, an object of the present application is to provide a transaction data storage method, apparatus, blockchain system and storage medium, so as to reduce network overhead and avoid the risk of single point of failure.
In a first aspect, an embodiment of the present application provides a transaction data storage method, which is applied to a blockchain system, where the blockchain system includes a plurality of transaction nodes, and each transaction node includes a plurality of transaction data arranged according to a time sequence, and the method includes:
aiming at any one transaction node to be processed in a plurality of transaction nodes, selecting one transaction node from other transaction nodes except the transaction node to be processed as a target transaction node;
acquiring first transaction data of a target transaction node between a first time node and a second time node, wherein the first time node is before the second time node;
acquiring second transaction data of the transaction node to be processed between the first time node and the second time node;
the hash values of the first transaction data and the second transaction data are combined and calculated;
and storing the hash value in a data block corresponding to the transaction node to be processed.
In an alternative embodiment, the method further comprises:
and generating at least one data block with corresponding size according to the transaction data on the transaction node to be processed according to the size of each data block.
In an optional embodiment, storing the hash value in a data block corresponding to the transaction node to be processed includes:
and storing the hash value in a data block generated by the transaction node to be processed after the second time node.
In an alternative embodiment, selecting one trading node as the target trading node from the other trading nodes except the to-be-processed trading node comprises:
and randomly selecting one transaction node from a plurality of other transaction nodes except the transaction node to be processed as a target transaction node through a random function.
In an alternative embodiment, the merging the hash values of the first transaction data and the second transaction data comprises:
merging the first transaction data and the second transaction data into a set of transaction data to be calculated;
and calculating the transaction data to be calculated through a Hash transformation function to obtain a corresponding Hash value.
In a second aspect, an embodiment of the present application provides a transaction data storage device, which is applied to a blockchain system, where the blockchain system includes a plurality of transaction nodes, each transaction node includes a plurality of transaction data arranged according to a time sequence, and the device includes:
the selection module is used for selecting one transaction node from other transaction nodes except the transaction node to be processed as a target transaction node aiming at any one transaction node to be processed in the transaction nodes;
the first transaction data acquisition module is used for acquiring first transaction data of a target transaction node between a first time node and a second time node, wherein the first time node is before the second time node;
the second transaction data acquisition module is used for acquiring second transaction data of the transaction node to be processed between the first time node and the second time node;
the hash value calculation module is used for calculating the hash values of the first transaction data and the second transaction data in a combined mode;
and the storage module is used for storing the hash value in a data block corresponding to the transaction node to be processed.
In an alternative embodiment, the apparatus further comprises:
and the data block generating module is used for generating at least one data block with corresponding size according to the size of each data block and the transaction data on the transaction node to be processed according to the time sequence.
In an alternative embodiment, the storage module is specifically configured to:
and storing the hash value in a data block generated by the transaction node to be processed after the second time node.
In a third aspect, an embodiment of the present application provides a blockchain system, including a plurality of electronic devices, each electronic device including a processor, a storage medium and a bus, where the storage medium stores machine-readable instructions executable by the processor, and when the blockchain system is operated, the processor and the storage medium communicate with each other through the bus, and the processor executes the machine-readable instructions to perform the transaction data storage method according to any one of the foregoing embodiments.
In a fourth aspect, embodiments of the present application provide a storage medium having a computer program stored thereon, where the computer program is executed by a processor to perform the steps of any one of the methods according to the foregoing embodiments.
The transaction data storage method, the transaction data storage device, the blockchain system and the storage medium provided by the embodiment of the application are applied to the blockchain system comprising a plurality of transaction nodes, and each transaction node comprises a plurality of transaction data arranged according to a time sequence. For any transaction node in the blockchain system, the hash value of the transaction data of the node in a time period and the hash value of the transaction data of other transaction nodes in the same time period are calculated in a combined mode, so that the transaction node comprises the transaction data of the transaction node and the transaction data of other transaction nodes, and the transaction data of a single transaction node can be prevented from being tampered. In addition, each transaction node of the application only carries out Hash calculation at a certain time node, global sequencing is not needed, the required network overhead is reduced, and the single-point fault risk caused by sequencing by only using one sequencing service node is eliminated.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required 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 application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
FIG. 1 is a flow chart of a transaction data storage method according to an embodiment of the present disclosure;
fig. 2 is a second flowchart of a transaction data storage method according to an embodiment of the present application;
fig. 3 is a flowchart illustrating sub-steps of step S104 according to an embodiment of the present disclosure;
FIG. 4 is a functional block diagram of a transaction data storage device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a blockchain system according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Description of the main element symbols: 10-blockchain system; 20-an electronic device; 21-a processor; 22-a memory; 23-a bus; 100-a transaction data storage; 101-a selection module; 102-a first transaction data acquisition module; 103-a second transaction data acquisition module; 104-a hash value calculation module; 105-a storage module; 106-data block generation module.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
In addition, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
The term "comprising" will be used in the embodiments of the present application to indicate the presence of the features claimed hereinafter, but does not exclude the addition of further features.
Referring to fig. 1, fig. 1 is a flowchart illustrating a transaction data storage method according to an embodiment of the present disclosure. In this embodiment, the transaction data storage method is applied to the blockchain system 10, where the blockchain system 10 includes a plurality of transaction nodes, each transaction node includes a plurality of transaction data arranged according to a time sequence, and the method includes:
step S101, aiming at any one transaction node to be processed in a plurality of transaction nodes, selecting one transaction node from other transaction nodes except the transaction node to be processed as a target transaction node.
Step S102, first transaction data of the target transaction node between the first time node and the second time node is obtained. Wherein the first time node precedes the second time node.
Step S103, acquiring second transaction data of the transaction node to be processed between the first time node and the second time node.
Step S104, combining and calculating the hash values of the first transaction data and the second transaction data;
step S105, storing the hash value in a data block corresponding to the transaction node to be processed.
In the above steps, for any one transaction node in the blockchain system 10, by calculating the hash value of the transaction data of the node in one time period and the transaction data of other transaction nodes in the same time period in a combined manner, the transaction node includes both the transaction data of the transaction node and the transaction data of other transaction nodes, and thus the transaction data of a single transaction node can be prevented from being tampered. In addition, each transaction node only performs hash calculation at a certain time node, global sequencing is not needed, required network overhead is reduced, and the risk of single point failure caused by sequencing by only using one sequencing service node is eliminated.
It should be noted that the transaction node refers to a node in the blockchain system 10 that generates different transaction data, and it should be understood that different enterprises correspond to different transaction nodes, and different subsidiaries of a large enterprise may also correspond to different transaction nodes. Each trading node has stored thereon trading data generated at the trading node, each trading data including a trading time.
In this embodiment, the first transaction data and the second transaction data are only used for distinguishing the transaction data on the target transaction node and the transaction node to be processed, and do not represent the sequence of the transaction data.
The above steps are exemplified below. For example, in the present embodiment, the blockchain system 10 includes 4 transaction nodes, P1, P2, P3, and P4, respectively, for any one transaction node to be processed in the 4 transaction nodes, such as P1.
The blockchain system 10 may perform the above steps at certain time intervals, for example, if the transaction time node generated by the first transaction data of the transaction nodes is T1, after a certain time, the transaction time node of the transaction data is T2, and after a certain time, the transaction time node of the transaction data is T3. The blockchain system 10 may perform the above steps at time node T2 or time node T3.
For example, at time node T2, the pending transaction node P1 selects one transaction node among the other transaction nodes (i.e., P2, P3, and P4) other than P1 as the target transaction node, e.g., P3.
Subsequently, first transaction data in the target transaction node (i.e., P3) is obtained, wherein the transaction time of the first transaction data is located between the first time node (i.e., T1 time node) and the second time node (i.e., T2 time node); second transaction data of the transaction node to be processed (i.e., P1) is obtained, wherein the transaction time of the second transaction data is also located between the first time node (i.e., T1 time node) and the second time node (i.e., T2 time node). Wherein the T1 time node is located before the second time node. After the first transaction data and the second transaction data are acquired, the first transaction data and the second transaction data are merged to calculate a hash value, and the hash value is stored in the data block of the transaction node to be processed P1.
It should be noted that the blockchain system 10 may also perform the above steps at time node T3 and calculate the hash value. At this time node, the first time node in the above steps S102 and S103 is the T2 time node, and the second time node is the T3 time node.
The blockchain system 10 may obtain the transaction data of the transaction node to be processed and the target transaction node in the time period at intervals according to the above steps, and combine and calculate the hash value and store the hash value.
Further, in the present embodiment, please refer to fig. 2, and fig. 2 is a second flowchart of the transaction data storage method according to the embodiment of the present application. In this embodiment, the transaction data storage method further includes:
and step S106, generating at least one data block with corresponding size according to the transaction data on the transaction node to be processed according to the time sequence according to the size of each data block.
In this step, when the hash value between the second transaction data of the transaction node to be processed and the first transaction data of the target transaction node is calculated at the second time node, after the second time node, the blockchain system 10 further generates at least one data block with a corresponding size according to the size of a preset data block from the transaction data on the transaction node to be processed according to the time sequence, and each data block is connected in a chained manner to form a chained data structure, i.e., a blockchain.
In another embodiment, the blockchain system 10 may also generate data blocks from transaction data on the transaction nodes to be processed in a chronological order based on the time limit for generating the blocks. For example, the time limit may be one hour, i.e., every other hour, and all transaction data in the period of time is generated into one data block.
For example, if 50 transaction data are generated on the pending transaction node P1 at time node T2, and the size of the predetermined data block is 5 transaction data (i.e. one data block includes 5 transaction data), the 50 transaction data on the P1 transaction node generate 10 data blocks in time sequence, each data block includes 5 transaction data.
It should be noted that, in addition to the above-mentioned setting of the size of the data block by the amount of the transaction data, the size of the data block may be set by the byte size, for example, the preset size of the data block may also be 1 GB.
In addition, the blockchain system 10 may perform the operation at a predetermined time interval when generating the data blocks, or may perform the operation when the size of the generated transaction data is large enough to generate one data block.
If the blockchain system 10 performs the operation of generating the data blocks at predetermined time intervals, the time intervals may be the same as or different from the time intervals for calculating the hash values. For example, the hash value may be calculated once after a plurality of data chunks are generated, or the hash value may be calculated once every data chunk is generated, and the specific operation may be set by a user according to a requirement, which is not limited herein.
Specifically, in this embodiment, step S105 specifically includes:
and storing the hash value in a data block generated by the transaction node to be processed after the second time node.
In this embodiment, after the hash values of the first transaction data and the second transaction data are combined and calculated at a certain time node, the calculated hash values are stored in the data blocks generated after the time node.
For example, if the time node at this time is T2 and the last time node is T1, when transaction data between T1 and T2 is acquired and the hash value is calculated in combination at the time node of T2, the hash value generated by the time node of T2 should be stored in the data chunk generated after the time node of T2.
It should be noted that only transaction data may be stored in one data block, or both transaction data and the hash value may be stored.
Further, in this embodiment, step S101 specifically includes:
and randomly selecting one transaction node from a plurality of other transaction nodes except the transaction node to be processed as a target transaction node through a random function.
In this embodiment, after the transaction node to be processed is determined, one transaction node is randomly selected as the target transaction node from all other transaction nodes in the blockchain system 10 through a random function. And then, the transaction data of the target transaction node and the transaction data of the transaction node to be processed are combined to calculate the hash value, so that the transaction data of a single transaction node can be prevented from being tampered.
For example, if the blockchain system 10 includes 4 transaction nodes, P1, P2, P3, and P4, respectively, if P1 is the pending transaction node. At a certain time node, randomly selecting one transaction node from P2, P3 and P4 as a target transaction node through a random function, such as P4, and then combining and calculating the hash values of P1 and P4 in corresponding time periods.
At the next time node, a trading node is randomly selected from P2, P3 and P4 as a target trading node through a random function, wherein the target trading node can be a P2 trading node or a P3 trading node, and the target trading node can also be a P4 trading node which is the same as the random result of the previous time node.
By means of random selection, the result of the target transaction node can be guaranteed to be unpredictable, and therefore the transaction data of a single transaction node is further prevented from being tampered.
Referring to fig. 3, fig. 3 is a flowchart illustrating sub-steps of step S104 according to an embodiment of the present disclosure. In the present embodiment, step S104 includes sub-step S1041 and sub-step S1042. Specifically, the method comprises the following steps:
step S1041, merging the first transaction data and the second transaction data into a set of transaction data to be calculated.
Step S1042, calculating the transaction data to be calculated by a hash transform function to obtain a corresponding hash value.
First, the hash transform function is used to map data of an arbitrary length into shorter fixed-length data, and this shorter data is referred to as a hash value. The hash value is a uniquely determined digest representation of a piece of data and can be used to determine whether the data has been tampered with. Hash transform functions typically include MD5, SHA-1, and SHA-2, among others.
In the substep, first, the first transaction data acquired from the target transaction node and the second transaction data acquired from the transaction data to be processed are merged to obtain the transaction data to be calculated, and then the merged transaction data to be calculated is calculated through a hash transformation function to obtain a hash value.
By the method, the transaction data of two different transaction nodes can be associated, and the transaction data of a single transaction node is prevented from being tampered.
It is noted that the above steps describe the steps performed for any one of the transaction nodes in the blockchain system 10. In the present embodiment, the execution steps of each transaction node in the blockchain system 10 are the same as the above steps, and will not be described in detail here.
In summary, the transaction data storage method, apparatus, blockchain system 10 and storage medium provided in the embodiments of the present application are applied to the blockchain system 10 including a plurality of transaction nodes, where each transaction node includes a plurality of transaction data arranged according to a time sequence. For any transaction node in the blockchain system 10, by calculating the hash value of the transaction data of the node in one time period and the transaction data of other transaction nodes in the same time period in a combined manner, the transaction node includes the transaction data of the transaction node and the transaction data of other transaction nodes, and the transaction data of a single transaction node can be prevented from being tampered. In addition, each transaction node of the application only carries out Hash calculation at a certain time node, global sequencing is not needed, the required network overhead is reduced, and the single-point fault risk caused by sequencing by only using one sequencing node is eliminated.
Based on the same inventive concept, the embodiment of the present application further provides a transaction data storage device 100 corresponding to the transaction data storage method, and since the principle of solving the problem of the device in the embodiment of the present application is similar to that of the transaction data storage method in the embodiment of the present application, the implementation of the device may refer to the implementation of the method, and repeated details are not repeated.
Referring to fig. 4, fig. 4 is a functional block diagram of a transaction data storage device 100 according to an embodiment of the present disclosure. In this embodiment, the apparatus is applied to a blockchain system 10, the blockchain system 10 includes a plurality of transaction nodes, each transaction node includes a plurality of transaction data arranged according to a time sequence, and the apparatus includes:
the selection module 101 is configured to select, for any one to-be-processed transaction node of the multiple transaction nodes, one transaction node from the other transaction nodes except the to-be-processed transaction node as a target transaction node.
The first transaction data obtaining module 102 is configured to obtain first transaction data of a target transaction node between a first time node and a second time node, where the first time node is before the second time node.
The second transaction data obtaining module 103 is configured to obtain second transaction data of the transaction node to be processed between the first time node and the second time node.
And the hash value calculation module 104 is configured to calculate a hash value of the first transaction data and the second transaction data in a combined manner.
And the storage module 105 is configured to store the hash value in a data block corresponding to the transaction node to be processed.
Further, with reference to fig. 4, in the present embodiment, the apparatus further includes:
and the data block generation module 106 is configured to generate at least one data block with a corresponding size from the transaction data on the transaction node to be processed according to the size of each data block.
Further, the storage module 105 is specifically configured to:
and storing the hash value in a data block generated by the transaction node to be processed after the second time node.
The description of the processing flow of each module in the device and the interaction flow between the modules may refer to the related description in the above method embodiments, and will not be described in detail here.
The present embodiment also provides a blockchain system 10, as shown in fig. 5, the blockchain system 10 includes a plurality of electronic devices 20, and the electronic devices 20 are communicatively connected to each other to form the blockchain system 10.
Further, referring to fig. 6, fig. 6 is a schematic structural diagram of an electronic device 20 according to an embodiment of the present application, including: a processor 21, a memory 22, and a bus 23. The memory 22 stores machine-readable instructions executable by the processor 21 (for example, execution instructions corresponding to a plurality of modules in the transaction data storage apparatus 100 in fig. 4, etc.), when the electronic device 20 is running, the processor 21 communicates with the memory 22 through the bus 23, and the machine-readable instructions are executed by the processor 21 to perform the above-mentioned transaction data storage method.
The embodiment of the present application also provides a storage medium, on which a computer program is stored, and when the computer program is executed by the processor 21, the computer program performs the steps of the above-mentioned transaction data storage method.
Specifically, the storage medium can be a general-purpose storage medium, such as a mobile disk, a hard disk, and the like, and when a computer program on the storage medium is executed, the method of any of the above embodiments can be executed, so that network overhead in a sorting process is reduced, a risk of a single point of failure is eliminated, and meanwhile, malicious tampering of transaction data of a single transaction node can be avoided.
In some embodiments, the processor 21 may include one or more processing cores (e.g., a single-core processor 21 (S) or a multi-core processor 21 (S)). Merely by way of example, the Processor 21 may include a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), an Application Specific Instruction Set Processor 21 (ASIP), a Graphics Processing Unit (GPU), a Physical Processing Unit (PPU), a Digital Signal Processor 21 (DSP), a Field Programmable Gate Array (FPGA), a Programmable Logic Device (PLD), a controller, a microcontroller Unit, a Reduced Instruction Set computer (Reduced Instruction Set computer, RISC), a microprocessor 21, or the like, or any combination thereof.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the electronic device 20 and the apparatus described above may refer to corresponding processes in the method embodiments, and are not described in detail in this application. In the several embodiments provided in the present application, it should be understood that the disclosed electronic device 20, apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, a division of modules is merely a division of logical functions, and an actual implementation may have another division, and for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or modules through some communication interfaces, and may be in an electrical, mechanical or other form.
Modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by the processor 21. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
In addition, in order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, functional units in various embodiments of the present application may be integrated into one body, and the technical solution in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Additionally, it should be understood that the schematic drawings are not necessarily drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of the present application.
It should be understood that the operations of the flow diagrams may be performed out of order, and steps without logical context may be performed in reverse order or simultaneously. One skilled in the art, under the guidance of this application, may add one or more other operations to, or remove one or more operations from, the flowchart.
In addition, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.

Claims (9)

1. A transaction data storage method applied to a blockchain system, wherein the blockchain system includes a plurality of transaction nodes, each transaction node includes a plurality of transaction data arranged according to a time sequence, and the method includes:
aiming at any one transaction node to be processed in the transaction nodes, selecting one transaction node from other transaction nodes except the transaction node to be processed as a target transaction node;
acquiring first transaction data of the target transaction node between a first time node and a second time node, wherein the first time node is before the second time node;
acquiring second transaction data of the transaction node to be processed between the first time node and the second time node;
the hash values of the first transaction data and the second transaction data are combined and calculated;
storing the hash value in a data block corresponding to the transaction node to be processed;
the merging calculating the hash value of the first transaction data and the second transaction data includes:
merging the first transaction data and the second transaction data into a set of transaction data to be calculated;
and calculating the transaction data to be calculated through a Hash transformation function to obtain a corresponding Hash value.
2. The method of claim 1, further comprising:
and generating at least one data block with corresponding size according to the transaction data on the transaction node to be processed according to the size of each data block.
3. The method of claim 2, wherein storing the hash value in a data block corresponding to the pending transaction node comprises:
and storing the hash value in a data block generated by the transaction node to be processed after the second time node.
4. The method of claim 1, wherein selecting one of the transaction nodes other than the pending transaction node as the target transaction node comprises:
and randomly selecting one transaction node from a plurality of other transaction nodes except the transaction node to be processed as a target transaction node through a random function.
5. A transaction data storage device for use in a blockchain system, the blockchain system including a plurality of transaction nodes, each of the transaction nodes including a plurality of transaction data arranged in a chronological order, the device comprising:
the selection module is used for selecting one transaction node from other transaction nodes except the transaction node to be processed as a target transaction node aiming at any one transaction node to be processed in the transaction nodes;
a first transaction data acquisition module, configured to acquire first transaction data of the target transaction node between a first time node and a second time node, where the first time node is before the second time node;
the second transaction data acquisition module is used for acquiring second transaction data of the transaction node to be processed between the first time node and the second time node;
the hash value calculation module is used for calculating the hash value of the first transaction data and the hash value of the second transaction data in a combined mode;
the storage module is used for storing the hash value in a data block corresponding to the transaction node to be processed;
the hash value calculation module is used for combining the first transaction data and the second transaction data into a group of transaction data to be calculated, and calculating the transaction data to be calculated through a hash transformation function to obtain a corresponding hash value.
6. The apparatus of claim 5, further comprising:
and the data block generating module is used for generating at least one data block with a corresponding size from the transaction data on the transaction node to be processed according to the time sequence according to the size of each data block.
7. The apparatus of claim 6, wherein the storage module is specifically configured to:
and storing the hash value in a data block generated by the transaction node to be processed after the second time node.
8. A blockchain system comprising a plurality of electronic devices, each electronic device comprising a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium communicating via the bus when the blockchain system is in operation, the processor executing the machine-readable instructions to perform the steps of the transaction data storage method according to any one of claims 1 to 4.
9. A storage medium having stored thereon a computer program for performing the steps of the transaction data storage method according to any one of claims 1 to 4 when executed by a processor.
CN202011250290.7A 2020-11-11 2020-11-11 Transaction data storage method, device, block chain system and storage medium Active CN112070613B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011250290.7A CN112070613B (en) 2020-11-11 2020-11-11 Transaction data storage method, device, block chain system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011250290.7A CN112070613B (en) 2020-11-11 2020-11-11 Transaction data storage method, device, block chain system and storage medium

Publications (2)

Publication Number Publication Date
CN112070613A CN112070613A (en) 2020-12-11
CN112070613B true CN112070613B (en) 2021-02-26

Family

ID=73655790

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011250290.7A Active CN112070613B (en) 2020-11-11 2020-11-11 Transaction data storage method, device, block chain system and storage medium

Country Status (1)

Country Link
CN (1) CN112070613B (en)

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10516538B2 (en) * 2016-11-01 2019-12-24 Netcomm Inc. System and method for digitally signing documents using biometric data in a blockchain or PKI
CN106682907A (en) * 2016-12-10 2017-05-17 江苏恒为信息科技有限公司 Comparison and consensus method for block chain data
KR102417067B1 (en) * 2017-12-08 2022-07-05 한국전자통신연구원 Method and apparatus for generating blocks in node on a block-chain network
CN108881169B (en) * 2018-05-21 2021-02-09 西安电子科技大学 Time distribution and synchronization method and system based on block chain and data processing system
CN110780848B (en) * 2019-10-16 2023-05-12 上海链度科技有限公司 Dual-random generation method and supervision system based on block chain distributed random process
CN111831669A (en) * 2019-12-20 2020-10-27 北京艾摩瑞策科技有限公司 Method and device for storing internet voting data according to block chain
CN111553689A (en) * 2020-05-21 2020-08-18 陈议尊 Matching correlation method and system based on quadratic hash

Also Published As

Publication number Publication date
CN112070613A (en) 2020-12-11

Similar Documents

Publication Publication Date Title
CN111240831A (en) Method and device for parallel execution of transactions in block chain, electronic equipment and storage medium
CN111865708B (en) Performance test method, platform, equipment and storage medium of Internet of things system
US10860538B2 (en) Data stream generation using prime numbers
CN111090645A (en) Data transmission method and device based on cloud storage and computer equipment
CN112286939A (en) Method, device and equipment for generating Hash of global state in block chain type account book
CN103246484B (en) A kind of date storage method, Apparatus and system
CN112907369A (en) Block chain-based data consensus method and device, electronic equipment and storage medium
CN110674109A (en) Data import method, system, computer device and computer readable storage medium
CN111158887A (en) Centralized data distributed processing method and device
CN112070613B (en) Transaction data storage method, device, block chain system and storage medium
CN111309548A (en) Timeout monitoring method and device and computer readable storage medium
CN110597688A (en) Monitoring information acquisition method and system
CN110008236B (en) Data distributed type self-increment coding method, system, equipment and medium
CN116841811A (en) Chip register test method and device, electronic equipment and storage medium
CN112003730A (en) Method, system, terminal and storage medium for rapid cluster deployment
CN111143347A (en) Object storage data consistency test method, system, terminal and storage medium
CN114513498B (en) File transmission verification method, device, computer equipment and storage medium
KR101710138B1 (en) Data distribution processing system and data distribution processing method
CN110888865A (en) Data processing method and device based on one-way linked list
JP6912104B2 (en) Test equipment, test methods and computer programs
CN111737260A (en) Method and system for checking data copying consistency
CN114138786A (en) Method, device, medium, product and equipment for duplicate removal of online transaction message
CN110888883A (en) Data storage method, device, system and storage medium
EP3961412A1 (en) Control method, data generation device, and program
CN110990475B (en) Batch task inserting method and device, computer equipment and storage medium

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
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: Room 303-309, No.3, Pazhou Avenue East Road, Haizhu District, Guangzhou City, Guangdong Province 510000

Patentee after: Shugen Internet Co.,Ltd.

Address before: Unit 12-30, 4th floor, Xigang office building, Guangzhou international media port, 218 and 220 Yuejiang West Road, Haizhu District, Guangzhou City, Guangdong Province 510000

Patentee before: IROOTECH TECHNOLOGY Co.,Ltd.